diff options
author | Henning Baldersheim <balder@oath.com> | 2018-08-20 14:44:30 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-08-20 14:44:30 +0200 |
commit | 0f79fff94ca457a0cb17954e59c4a16416603ccd (patch) | |
tree | 4d592d972f8f87e2ea95f644795bfb4978313cd0 | |
parent | fd63bb0dcd024fdd47d460fff0b077625328eaa1 (diff) |
Remove logging of metric events that has not been used for the later years.
14 files changed, 7 insertions, 265 deletions
diff --git a/searchcore/src/apps/fdispatch/fdispatch.cpp b/searchcore/src/apps/fdispatch/fdispatch.cpp index 97cfdcb408c..cd3ef3b7550 100644 --- a/searchcore/src/apps/fdispatch/fdispatch.cpp +++ b/searchcore/src/apps/fdispatch/fdispatch.cpp @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/searchcore/fdispatch/program/fdispatch.h> -#include <vespa/searchcore/fdispatch/common/perftask.h> #include <vespa/vespalib/net/state_server.h> #include <vespa/vespalib/net/simple_health_producer.h> #include <vespa/vespalib/net/simple_metrics_producer.h> @@ -96,7 +95,6 @@ FastS_FDispatchApp::Main() vespalib::SimpleHealthProducer health; vespalib::SimpleMetricsProducer metrics; vespalib::StateServer stateServer(myfdispatch->getHealthPort(), health, metrics, myfdispatch->getComponentConfig()); - FastS_PerfTask perfTask(*myfdispatch, 300.0); while (!CheckShutdownFlags()) { if (myfdispatch->Failed()) { throw std::runtime_error("myfdispatch->Failed()"); diff --git a/searchcore/src/vespa/searchcore/fdispatch/common/CMakeLists.txt b/searchcore/src/vespa/searchcore/fdispatch/common/CMakeLists.txt index 7a91efcd2ec..45261162e93 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/common/CMakeLists.txt +++ b/searchcore/src/vespa/searchcore/fdispatch/common/CMakeLists.txt @@ -2,8 +2,6 @@ vespa_add_library(searchcore_fdcommon STATIC SOURCES appcontext.cpp - perftask.cpp - queryperf.cpp rpc.cpp search.cpp timestat.cpp diff --git a/searchcore/src/vespa/searchcore/fdispatch/common/appcontext.cpp b/searchcore/src/vespa/searchcore/fdispatch/common/appcontext.cpp index 248babad316..78efc1f7429 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/common/appcontext.cpp +++ b/searchcore/src/vespa/searchcore/fdispatch/common/appcontext.cpp @@ -28,53 +28,38 @@ FastS_AppContext::FastS_AppContext() _createTime = _timeKeeper.GetTime(); } - -FastS_AppContext::~FastS_AppContext() -{ -} - +FastS_AppContext::~FastS_AppContext() = default; FNET_Transport * FastS_AppContext::GetFNETTransport() { - return NULL; + return nullptr; } - FNET_Scheduler * FastS_AppContext::GetFNETScheduler() { - return NULL; + return nullptr; } - FastS_NodeManager * FastS_AppContext::GetNodeManager() { - return NULL; + return nullptr; } - FastS_DataSetCollection * FastS_AppContext::GetDataSetCollection() { - return NULL; + return nullptr; } - FastOS_ThreadPool * FastS_AppContext::GetThreadPool() { - return NULL; -} - - -void -FastS_AppContext::logPerformance() -{ + return nullptr; } - uint32_t FastS_AppContext::getDispatchLevel() { diff --git a/searchcore/src/vespa/searchcore/fdispatch/common/appcontext.h b/searchcore/src/vespa/searchcore/fdispatch/common/appcontext.h index 7a5652577a0..fce468b4532 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/common/appcontext.h +++ b/searchcore/src/vespa/searchcore/fdispatch/common/appcontext.h @@ -41,7 +41,6 @@ public: virtual FNET_Scheduler *GetFNETScheduler(); virtual FastS_DataSetCollection *GetDataSetCollection(); virtual FastOS_ThreadPool *GetThreadPool(); - virtual void logPerformance(); virtual uint32_t getDispatchLevel(); private: }; diff --git a/searchcore/src/vespa/searchcore/fdispatch/common/perftask.cpp b/searchcore/src/vespa/searchcore/fdispatch/common/perftask.cpp deleted file mode 100644 index 17113285fab..00000000000 --- a/searchcore/src/vespa/searchcore/fdispatch/common/perftask.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "perftask.h" -#include "appcontext.h" - -#include <vespa/log/log.h> -LOG_SETUP(".perftask"); - -FastS_PerfTask::FastS_PerfTask(FastS_AppContext &ctx, double delay) - : FNET_Task(ctx.GetFNETScheduler()), - _ctx(ctx), - _delay(delay), - _valid(ctx.GetFNETScheduler() != NULL) -{ - if (_valid) { - ScheduleNow(); - } else { - LOG(warning, "Performance monitoring disabled; " - "no scheduler found in application context"); - } -} - - -FastS_PerfTask::~FastS_PerfTask() -{ - if (_valid) { - Kill(); - } -} - - -void -FastS_PerfTask::PerformTask() -{ - Schedule(_delay); - _ctx.logPerformance(); -} diff --git a/searchcore/src/vespa/searchcore/fdispatch/common/perftask.h b/searchcore/src/vespa/searchcore/fdispatch/common/perftask.h deleted file mode 100644 index 09c3b9840ab..00000000000 --- a/searchcore/src/vespa/searchcore/fdispatch/common/perftask.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#pragma once - -#include <vespa/fnet/task.h> - -class FastS_AppContext; - -class FastS_PerfTask : public FNET_Task -{ -private: - FastS_AppContext &_ctx; - double _delay; - bool _valid; - - FastS_PerfTask(const FastS_PerfTask &); - FastS_PerfTask &operator=(const FastS_PerfTask &); - -public: - FastS_PerfTask(FastS_AppContext &ctx, double delay); - ~FastS_PerfTask(); - void PerformTask() override; - bool isValid() const { return _valid; } -}; - diff --git a/searchcore/src/vespa/searchcore/fdispatch/common/queryperf.cpp b/searchcore/src/vespa/searchcore/fdispatch/common/queryperf.cpp deleted file mode 100644 index a0cc89d15c6..00000000000 --- a/searchcore/src/vespa/searchcore/fdispatch/common/queryperf.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "queryperf.h" - -#include <vespa/log/log.h> -LOG_SETUP(".queryperf"); - -namespace { - -struct MyLogTask : vespalib::Executor::Task { - uint32_t queueLen; - uint32_t activeCnt; - uint32_t queryCnt; - uint32_t dropCnt; - uint32_t timeoutCnt; - double avgQueryTime; - MyLogTask(uint32_t queueLen_in, - uint32_t activeCnt_in, - uint32_t queryCnt_in, - uint32_t dropCnt_in, - uint32_t timeoutCnt_in, - double avgQueryTime_in) - : queueLen(queueLen_in), - activeCnt(activeCnt_in), - queryCnt(queryCnt_in), - dropCnt(dropCnt_in), - timeoutCnt(timeoutCnt_in), - avgQueryTime(avgQueryTime_in) - { - } - void run() override { - EV_VALUE("queued_queries", queueLen); - EV_VALUE("active_queries", activeCnt); - EV_COUNT("queries", queryCnt); - EV_COUNT("dropped_queries", dropCnt); - EV_COUNT("timedout_queries", timeoutCnt); - if (avgQueryTime > 0.0) { - EV_VALUE("query_eval_time_avg_s", avgQueryTime); - } - } -}; - -} // namespace <unnamed> - -FastS_QueryPerf::FastS_QueryPerf() - : queueLen(0), - activeCnt(0), - queryCnt(0), - queryTime(0), - dropCnt(0), - timeoutCnt(0), - _lastQueryCnt(0), - _lastQueryTime(0.0) -{ -} - -void -FastS_QueryPerf::reset() -{ - queueLen = 0; - activeCnt = 0; - queryCnt = 0; - queryTime = 0; - dropCnt = 0; - timeoutCnt = 0; -} - -vespalib::Executor::Task::UP -FastS_QueryPerf::make_log_task() -{ - double avgQueryTime = 0.0; - if (queryCnt > _lastQueryCnt) { - avgQueryTime = (queryTime - _lastQueryTime) - / ((double)(queryCnt - _lastQueryCnt)); - } - _lastQueryCnt = queryCnt; - _lastQueryTime = queryTime; - return std::make_unique<MyLogTask>(queueLen, - activeCnt, - queryCnt, - dropCnt, - timeoutCnt, - avgQueryTime); -} diff --git a/searchcore/src/vespa/searchcore/fdispatch/common/queryperf.h b/searchcore/src/vespa/searchcore/fdispatch/common/queryperf.h deleted file mode 100644 index ee31a8e58b2..00000000000 --- a/searchcore/src/vespa/searchcore/fdispatch/common/queryperf.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#pragma once - -#include <cstdint> -#include <vespa/vespalib/util/executor.h> - -struct FastS_QueryPerf -{ - uint32_t queueLen; - uint32_t activeCnt; - uint32_t queryCnt; - double queryTime; - uint32_t dropCnt; - uint32_t timeoutCnt; - - FastS_QueryPerf(); - - /** - * reset all values except the cached 'old' values. This will - * prepare the object for reuse logging wise. - **/ - void reset(); - vespalib::Executor::Task::UP make_log_task(); - -private: - uint32_t _lastQueryCnt; - double _lastQueryTime; -}; - diff --git a/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.cpp b/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.cpp index b68566c3c9b..93680a95d44 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.cpp +++ b/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.cpp @@ -389,13 +389,6 @@ Fdispatch::Init() return true; } - -void -Fdispatch::logPerformance() -{ - _nodeManager->logPerformance(_executor); -} - uint32_t Fdispatch::getDispatchLevel() { diff --git a/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.h b/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.h index 6cfb4bfb5a1..093308d68d2 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.h +++ b/searchcore/src/vespa/searchcore/fdispatch/program/fdispatch.h @@ -96,7 +96,6 @@ public: virtual FastS_NodeManager *GetNodeManager() override; virtual FastS_DataSetCollection *GetDataSetCollection() override; virtual FastOS_ThreadPool *GetThreadPool() override; - virtual void logPerformance() override; virtual uint32_t getDispatchLevel() override; bool CheckTempFail(); bool Failed(); diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp b/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp index 1b96a48d35b..519960bfad0 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp +++ b/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp @@ -248,14 +248,12 @@ FastS_DataSetBase::AbortQueryQueue_HasLock() } } - void FastS_DataSetBase::AddCost() { _totalrefcost += _unitrefcost; } - void FastS_DataSetBase::SubCost() { @@ -263,10 +261,8 @@ FastS_DataSetBase::SubCost() _totalrefcost -= _unitrefcost; } - void -FastS_DataSetBase::UpdateSearchTime(double tnow, - double elapsed, bool timedout) +FastS_DataSetBase::UpdateSearchTime(double tnow, double elapsed, bool timedout) { int slot; auto dsGuard(getDsGuard()); @@ -279,36 +275,18 @@ FastS_DataSetBase::UpdateSearchTime(double tnow, _total._normalTimeStat.Update(tnow, elapsed, timedout); } - void FastS_DataSetBase::UpdateEstimateCount() { ++_total._estimates; } - void FastS_DataSetBase::CountTimeout() { ++_total._nTimedOut; } - -void -FastS_DataSetBase::addPerformance(FastS_QueryPerf &qp) -{ - FastS_TimeStatTotals totals; - auto dsGuard(getDsGuard()); - _total._normalTimeStat.AddTotal(&totals); - qp.queueLen += _queryQueue.GetQueueLen(); - qp.activeCnt += _queryQueue.GetActiveQueries(); - qp.queryCnt += totals._totalCount; - qp.queryTime += totals._totalAccTime; - qp.dropCnt += _total._nOverload; - qp.timeoutCnt += _total._nTimedOut; -} - - ChildInfo FastS_DataSetBase::getChildInfo() const { diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h b/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h index 042e18bf96f..f4f69285e89 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h +++ b/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h @@ -20,7 +20,6 @@ class FastS_QueryResult; class FastS_PlainDataSet; class FastS_FNET_DataSet; class FastS_AppContext; -class FastS_QueryPerf; class FNET_Task; //--------------------------------------------------------------------------- @@ -220,13 +219,9 @@ public: FastS_TimeKeeper *timeKeeper, bool async) = 0; virtual void Free() = 0; - virtual void addPerformance(FastS_QueryPerf &qp); // typesafe down-cast //------------------- virtual FastS_PlainDataSet *GetPlainDataSet() { return nullptr; } virtual FastS_FNET_DataSet *GetFNETDataSet() { return nullptr; } }; - -//--------------------------------------------------------------------------- - diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/nodemanager.cpp b/searchcore/src/vespa/searchcore/fdispatch/search/nodemanager.cpp index 879009c384f..f2af03d4c52 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/nodemanager.cpp +++ b/searchcore/src/vespa/searchcore/fdispatch/search/nodemanager.cpp @@ -88,7 +88,6 @@ FastS_NodeManager::FastS_NodeManager(vespalib::SimpleComponentConfigProducer &co _mldDocStamp(0), _mldDocStampMin(0), _gencnt(0), - _queryPerf(), _fetcher(), _configUri(config::ConfigUri::createEmpty()), _lastPartMap(NULL), @@ -389,24 +388,6 @@ FastS_NodeManager::getChildInfo() return r; } - -void -FastS_NodeManager::logPerformance(vespalib::Executor &executor) -{ - _queryPerf.reset(); - FastS_DataSetCollection *dsc = GetDataSetCollection(); - - for (unsigned int i = 0; i < dsc->GetMaxNumDataSets(); i++) { - if (dsc->PeekDataSet(i) != NULL) { - dsc->PeekDataSet(i)->addPerformance(_queryPerf); - } - } - - dsc->subRef(); - executor.execute(_queryPerf.make_log_task()); -} - - void FastS_NodeManager::CheckEvents(FastS_TimeKeeper *timeKeeper) { diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/nodemanager.h b/searchcore/src/vespa/searchcore/fdispatch/search/nodemanager.h index 77d4482fba7..70dc80914f4 100644 --- a/searchcore/src/vespa/searchcore/fdispatch/search/nodemanager.h +++ b/searchcore/src/vespa/searchcore/fdispatch/search/nodemanager.h @@ -5,7 +5,6 @@ #include "child_info.h" #include "configdesc.h" #include <vespa/config/helper/configfetcher.h> -#include <vespa/searchcore/fdispatch/common/queryperf.h> #include <vespa/vespalib/net/simple_component_config_producer.h> #include <vespa/config/subscription/configuri.h> #include <vespa/vespalib/util/executor.h> @@ -34,7 +33,6 @@ private: uint32_t _mldDocStampMin; // Bumped for global cache flush uint32_t _gencnt; - FastS_QueryPerf _queryPerf; std::unique_ptr<config::ConfigFetcher> _fetcher; @@ -89,12 +87,6 @@ public: ChildInfo getChildInfo(); void ShutdownConfig(); - /** - * log query performance. This method should only be invoked from - * the FNET thread. - **/ - void logPerformance(vespalib::Executor &executor); - void CheckEvents(FastS_TimeKeeper *timeKeeper); // invoked by FNET thread }; |