From 027801d93edfac9b172052c65d65a683150d6b2c Mon Sep 17 00:00:00 2001 From: Geir Storli Date: Thu, 31 Aug 2023 11:46:16 +0000 Subject: Add saturation metric for executors. This should make it easier to observe bottlenecks in one of the underlying executor threads used in the "field writer" SequencedTaskExecutor. --- searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp | 4 ++++ searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.h | 1 + 2 files changed, 5 insertions(+) (limited to 'searchcore') diff --git a/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp b/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp index 7c4dcf434a3..b7079542c06 100644 --- a/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp +++ b/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp @@ -11,6 +11,7 @@ ExecutorMetrics::update(const vespalib::ExecutorStats &stats) rejected.inc(stats.rejectedTasks); wakeupCount.inc(stats.wakeupCount); util.set(stats.getUtil()); + saturation.set(stats.get_saturation()); const auto & qSize = stats.queueSize; queueSize.addValueBatch(qSize.average(), qSize.count(), qSize.min(), qSize.max()); } @@ -21,6 +22,9 @@ ExecutorMetrics::ExecutorMetrics(const std::string &name, metrics::MetricSet *pa rejected("rejected", {}, "Number of rejected tasks", this), wakeupCount("wakeups", {}, "Number of times a worker thread has been woken up", this), util("utilization", {}, "Ratio of time the worker threads has been active", this), + saturation("saturation", {}, "Ratio indicating how saturated the worker threads has been. " + "For most executors this ratio is equal to utilization, but for others (e.g SequencedTaskExecutor) " + " a higher saturation than utilization indicates a bottleneck in a subset of the worker threads.", 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 af3a27da240..cd6181b108c 100644 --- a/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.h +++ b/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.h @@ -15,6 +15,7 @@ struct ExecutorMetrics : metrics::MetricSet metrics::LongCountMetric rejected; metrics::LongCountMetric wakeupCount; metrics::DoubleValueMetric util; + metrics::DoubleValueMetric saturation; metrics::LongAverageMetric queueSize; void update(const vespalib::ExecutorStats &stats); -- cgit v1.2.3