diff options
author | Tor Egge <Tor.Egge@oath.com> | 2018-03-06 12:43:18 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2018-03-06 12:43:18 +0000 |
commit | 159fce3cff5cd0050928491929dd6383b0957341 (patch) | |
tree | cc8d6aad7eba31cc3229c6a51dba76d7e4e97de6 | |
parent | 0660317cc8304b16d178312bcafacb27ece2842b (diff) |
Add metrics for executor threading service.
6 files changed, 68 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt b/searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt index 6fe95da2197..6972f6caa98 100644 --- a/searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt +++ b/searchcore/src/vespa/searchcore/proton/metrics/CMakeLists.txt @@ -7,6 +7,7 @@ vespa_add_library(searchcore_proton_metrics STATIC documentdb_metrics_collection.cpp documentdb_tagged_metrics.cpp executor_metrics.cpp + executor_threading_service_metrics.cpp executor_threading_service_stats.cpp job_load_sampler.cpp job_tracker.cpp diff --git a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp index 522951412b7..d704fa6616e 100644 --- a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp +++ b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.cpp @@ -92,7 +92,8 @@ DocumentDBTaggedMetrics::DocumentDBTaggedMetrics(const vespalib::string &docType index(this), ready("ready", this), notReady("notready", this), - removed("removed", this) + removed("removed", this), + threadingService("threading_service", this) { } DocumentDBTaggedMetrics::~DocumentDBTaggedMetrics() { } diff --git a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h index 2b31de03b63..5b8298fd2cb 100644 --- a/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h +++ b/searchcore/src/vespa/searchcore/proton/metrics/documentdb_tagged_metrics.h @@ -3,6 +3,7 @@ #include "attribute_metrics.h" #include "memory_usage_metrics.h" +#include "executor_threading_service_metrics.h" #include <vespa/metrics/metricset.h> #include <vespa/metrics/valuemetric.h> @@ -97,6 +98,7 @@ struct DocumentDBTaggedMetrics : metrics::MetricSet SubDBMetrics ready; SubDBMetrics notReady; SubDBMetrics removed; + ExecutorThreadingServiceMetrics threadingService; DocumentDBTaggedMetrics(const vespalib::string &docTypeName); ~DocumentDBTaggedMetrics(); diff --git a/searchcore/src/vespa/searchcore/proton/metrics/executor_threading_service_metrics.cpp b/searchcore/src/vespa/searchcore/proton/metrics/executor_threading_service_metrics.cpp new file mode 100644 index 00000000000..2b7908633c9 --- /dev/null +++ b/searchcore/src/vespa/searchcore/proton/metrics/executor_threading_service_metrics.cpp @@ -0,0 +1,32 @@ +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include "executor_threading_service_metrics.h" +#include "executor_threading_service_stats.h" + +namespace proton { + +ExecutorThreadingServiceMetrics::ExecutorThreadingServiceMetrics(const std::string &name, metrics::MetricSet *parent) + : metrics::MetricSet(name, "", "Instance specific threading service metrics", parent), + master("master", this), + index("index", this), + summary("summary", this), + indexFieldInverter("index_field_inverter", this), + indexFieldWriter("index_field_writer", this), + attributeFieldWriter("attribute_field_writer", this) +{ +} + +ExecutorThreadingServiceMetrics::~ExecutorThreadingServiceMetrics() = default; + +void +ExecutorThreadingServiceMetrics::update(const ExecutorThreadingServiceStats &stats) +{ + master.update(stats.getMasterExecutorStats()); + index.update(stats.getIndexExecutorStats()); + summary.update(stats.getSummaryExecutorStats()); + indexFieldInverter.update(stats.getIndexFieldInverterExecutorStats()); + indexFieldWriter.update(stats.getIndexFieldWriterExecutorStats()); + attributeFieldWriter.update(stats.getAttributeFieldWriterExecutorStats()); +} + +} diff --git a/searchcore/src/vespa/searchcore/proton/metrics/executor_threading_service_metrics.h b/searchcore/src/vespa/searchcore/proton/metrics/executor_threading_service_metrics.h new file mode 100644 index 00000000000..18326143c65 --- /dev/null +++ b/searchcore/src/vespa/searchcore/proton/metrics/executor_threading_service_metrics.h @@ -0,0 +1,29 @@ +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +#include "executor_metrics.h" + +namespace proton { + +class ExecutorThreadingServiceStats; + +/* + * Metrics for executor threading service, i.e. tasks + * accepted/rejected, queue len for each executor in a document db. + */ +struct ExecutorThreadingServiceMetrics : metrics::MetricSet +{ + ExecutorMetrics master; + ExecutorMetrics index; + ExecutorMetrics summary; + ExecutorMetrics indexFieldInverter; + ExecutorMetrics indexFieldWriter; + ExecutorMetrics attributeFieldWriter; + + void update(const ExecutorThreadingServiceStats &stats); + ExecutorThreadingServiceMetrics(const std::string &name, metrics::MetricSet *parent); + ~ExecutorThreadingServiceMetrics(); +}; + +} diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp index 8cb64dc05f9..73dfedeb867 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp @@ -1270,8 +1270,9 @@ updateMetrics(DocumentDBTaggedMetrics::AttributeMetrics &metrics) } void -DocumentDB::updateMetrics(DocumentDBTaggedMetrics &metrics, const ExecutorThreadingServiceStats &) +DocumentDB::updateMetrics(DocumentDBTaggedMetrics &metrics, const ExecutorThreadingServiceStats &threadingServiceStats) { + metrics.threadingService.update(threadingServiceStats); _jobTrackers.updateMetrics(metrics.job); updateMetrics(metrics.attribute); |