diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-10-19 05:06:06 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-10-22 07:31:50 +0000 |
commit | 86e9a67362a9e8de7a4a267f6450b41cc60be290 (patch) | |
tree | 6f0e34f9ed012bdf6fa2eeecdb97fd89ee54e092 /searchcore | |
parent | 7ec9aa11869ffdba64a0009a7396a4483a045cf5 (diff) |
Add a metric for how many times a worker in a thread pool has woken up.
Also track the idle time a worker has and add metric for the utilization.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp | 4 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.h | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp b/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp index 74e0971178c..789e97138e0 100644 --- a/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp +++ b/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp @@ -10,6 +10,8 @@ ExecutorMetrics::update(const vespalib::ExecutorStats &stats) maxPending.set(stats.queueSize.max()); accepted.inc(stats.acceptedTasks); rejected.inc(stats.rejectedTasks); + wakeupCount.inc(stats.wakeupCount); + util.set(stats.getUtil()); const auto & qSize = stats.queueSize; queueSize.addValueBatch(qSize.average(), qSize.count(), qSize.min(), qSize.max()); } @@ -19,6 +21,8 @@ ExecutorMetrics::ExecutorMetrics(const std::string &name, metrics::MetricSet *pa maxPending("maxpending", {}, "Maximum number of pending (active + queued) tasks", this), accepted("accepted", {}, "Number of accepted tasks", this), rejected("rejected", {}, "Number of rejected tasks", this), + wakeupCount("wakeupCount", {}, "Number of times a worker thread has been woken up", this), + util("utilization", {}, "ratio of time the worker threads has been active", this), queueSize("queuesize", {}, "Size of task queue", this) { } diff --git a/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.h b/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.h index 273c4ed8979..31d959a399f 100644 --- a/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.h +++ b/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.h @@ -11,9 +11,11 @@ namespace proton { struct ExecutorMetrics : metrics::MetricSet { - metrics::LongValueMetric maxPending; // TODO Remove on Vespa 8 or sooner if possible. - metrics::LongCountMetric accepted; - metrics::LongCountMetric rejected; + metrics::LongValueMetric maxPending; // TODO Remove on Vespa 8 or sooner if possible. + metrics::LongCountMetric accepted; + metrics::LongCountMetric rejected; + metrics::LongCountMetric wakeupCount; + metrics::DoubleValueMetric util; metrics::LongAverageMetric queueSize; void update(const vespalib::ExecutorStats &stats); |