diff options
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp | 7 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.h | 3 |
2 files changed, 7 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 710c072aa53..f4e9bff1b4b 100644 --- a/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp +++ b/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.cpp @@ -7,16 +7,19 @@ namespace proton { void ExecutorMetrics::update(const vespalib::ThreadStackExecutorBase::Stats &stats) { - maxPending.set(stats.maxPendingTasks); + maxPending.set(stats.queueSize.max()); accepted.inc(stats.acceptedTasks); rejected.inc(stats.rejectedTasks); + const vespalib::ThreadStackExecutorBase::Stats::QueueSizeT & qSize = stats.queueSize; + queueSize.addValueBatch(qSize.average(), qSize.count(), qSize.min(), qSize.max()); } ExecutorMetrics::ExecutorMetrics(const std::string &name, metrics::MetricSet *parent) : metrics::MetricSet(name, {}, "Instance specific thread executor metrics", parent), maxPending("maxpending", {}, "Maximum number of pending (active + queued) tasks", this), accepted("accepted", {}, "Number of accepted tasks", this), - rejected("rejected", {}, "Number of rejected tasks", this) + rejected("rejected", {}, "Number of rejected tasks", 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 a347edffd4b..6b638391d1e 100644 --- a/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.h +++ b/searchcore/src/vespa/searchcore/proton/metrics/executor_metrics.h @@ -11,9 +11,10 @@ namespace proton { struct ExecutorMetrics : metrics::MetricSet { - metrics::LongValueMetric maxPending; + metrics::LongValueMetric maxPending; // TODO Remove on Vespa 8 or sooner if possible. metrics::LongCountMetric accepted; metrics::LongCountMetric rejected; + metrics::LongAverageMetric queueSize; void update(const vespalib::ThreadStackExecutorBase::Stats &stats); ExecutorMetrics(const std::string &name, metrics::MetricSet *parent); |