summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2018-09-18 15:28:32 +0000
committerGeir Storli <geirst@oath.com>2018-09-18 15:28:32 +0000
commit4075ea2e791c00d8af97ce45bfbfd293a478d24a (patch)
tree8a97aef03ca310a0ace17bb6bd34b8bcaffe343d /searchcore
parentce6c9e7201683013d9bfec9a8fb522d95252f565 (diff)
Migrate legacy proton executor metrics and add missing metrics.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/content_proton_metrics.cpp20
-rw-r--r--searchcore/src/vespa/searchcore/proton/metrics/content_proton_metrics.h19
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp27
3 files changed, 55 insertions, 11 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/content_proton_metrics.cpp b/searchcore/src/vespa/searchcore/proton/metrics/content_proton_metrics.cpp
index 7e835373e41..7b1ed5d6522 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/content_proton_metrics.cpp
+++ b/searchcore/src/vespa/searchcore/proton/metrics/content_proton_metrics.cpp
@@ -4,13 +4,27 @@
namespace proton {
+ContentProtonMetrics::ProtonExecutorMetrics::ProtonExecutorMetrics(metrics::MetricSet *parent)
+ : metrics::MetricSet("executor", "", "Metrics for top-level executors shared among all document databases", parent),
+ proton("proton", this),
+ flush("flush", this),
+ match("match", this),
+ docsum("docsum", this),
+ shared("shared", this),
+ warmup("warmup", this)
+{
+}
+
+ContentProtonMetrics::ProtonExecutorMetrics::~ProtonExecutorMetrics() = default;
+
ContentProtonMetrics::ContentProtonMetrics()
: metrics::MetricSet("content.proton", "", "Search engine metrics", nullptr),
transactionLog(this),
- resourceUsage(this)
+ resourceUsage(this),
+ executor(this)
{
}
-ContentProtonMetrics::~ContentProtonMetrics() {}
+ContentProtonMetrics::~ContentProtonMetrics() = default;
-} // namespace proton
+}
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/content_proton_metrics.h b/searchcore/src/vespa/searchcore/proton/metrics/content_proton_metrics.h
index d2a53b12a02..ef66314f658 100644
--- a/searchcore/src/vespa/searchcore/proton/metrics/content_proton_metrics.h
+++ b/searchcore/src/vespa/searchcore/proton/metrics/content_proton_metrics.h
@@ -2,9 +2,10 @@
#pragma once
-#include <vespa/metrics/metrics.h>
+#include "executor_metrics.h"
#include "resource_usage_metrics.h"
#include "trans_log_server_metrics.h"
+#include <vespa/metrics/metrics.h>
namespace proton {
@@ -18,12 +19,26 @@ namespace proton {
*/
struct ContentProtonMetrics : metrics::MetricSet
{
+ struct ProtonExecutorMetrics : metrics::MetricSet {
+
+ ExecutorMetrics proton;
+ ExecutorMetrics flush;
+ ExecutorMetrics match;
+ ExecutorMetrics docsum;
+ ExecutorMetrics shared;
+ ExecutorMetrics warmup;
+
+ ProtonExecutorMetrics(metrics::MetricSet *parent);
+ ~ProtonExecutorMetrics();
+ };
+
TransLogServerMetrics transactionLog;
ResourceUsageMetrics resourceUsage;
+ ProtonExecutorMetrics executor;
ContentProtonMetrics();
~ContentProtonMetrics();
};
-} // namespace proton
+}
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
index 9da7f385389..2174412bedf 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
@@ -658,7 +658,15 @@ int countOpenFiles()
return count;
}
-} // namespace <unnamed>
+void
+updateExecutorMetrics(ExecutorMetrics &metrics, ExecutorMetrics &legacyMetrics,
+ const vespalib::ThreadStackExecutor::Stats &stats)
+{
+ metrics.update(stats);
+ legacyMetrics.update(stats);
+}
+
+}
void
Proton::updateMetrics(const vespalib::MonitorGuard &)
@@ -681,16 +689,23 @@ Proton::updateMetrics(const vespalib::MonitorGuard &)
metrics.resourceUsage.feedingBlocked.set((usageFilter.acceptWriteOperation() ? 0.0 : 1.0));
}
{
- LegacyProtonMetrics &metrics = _metricsEngine->legacyRoot();
- metrics.executor.update(_executor.getStats());
+ ContentProtonMetrics::ProtonExecutorMetrics &metrics = _metricsEngine->root().executor;
+ LegacyProtonMetrics &legacyMetrics = _metricsEngine->legacyRoot();
+ updateExecutorMetrics(metrics.proton, legacyMetrics.executor, _executor.getStats());
if (_flushEngine) {
- metrics.flushExecutor.update(_flushEngine->getExecutorStats());
+ updateExecutorMetrics(metrics.flush, legacyMetrics.flushExecutor, _flushEngine->getExecutorStats());
}
if (_matchEngine) {
- metrics.matchExecutor.update(_matchEngine->getExecutorStats());
+ updateExecutorMetrics(metrics.match, legacyMetrics.matchExecutor, _matchEngine->getExecutorStats());
}
if (_summaryEngine) {
- metrics.summaryExecutor.update(_summaryEngine->getExecutorStats());
+ updateExecutorMetrics(metrics.docsum, legacyMetrics.summaryExecutor, _summaryEngine->getExecutorStats());
+ }
+ if (_sharedExecutor) {
+ metrics.shared.update(_sharedExecutor->getStats());
+ }
+ if (_warmupExecutor) {
+ metrics.warmup.update(_warmupExecutor->getStats());
}
}
}