diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-23 11:19:30 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-23 11:19:30 +0000 |
commit | 31006e5945dd26d28d0157829862f61c405435ca (patch) | |
tree | 39dfe6a95b4489c1d61f0fad2023d2cb2ebf2de7 /metrics | |
parent | 9190653f24b07563ca70d1fb0263b8f3e9c8440f (diff) |
Add metirc for buckets pending move.
Diffstat (limited to 'metrics')
-rw-r--r-- | metrics/src/vespa/metrics/countmetric.h | 6 | ||||
-rw-r--r-- | metrics/src/vespa/metrics/countmetric.hpp | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/metrics/src/vespa/metrics/countmetric.h b/metrics/src/vespa/metrics/countmetric.h index de34e9330e6..02a6827d1ce 100644 --- a/metrics/src/vespa/metrics/countmetric.h +++ b/metrics/src/vespa/metrics/countmetric.h @@ -54,11 +54,9 @@ public: CountMetric(const CountMetric<T, SumOnAdd>& other, CopyType, MetricSet* owner); - ~CountMetric(); + ~CountMetric() override; - MetricValueClass::UP getValues() const override { - return MetricValueClass::UP(new Values(_values.getValues())); - } + MetricValueClass::UP getValues() const override; void set(T value); void inc(T value = 1); diff --git a/metrics/src/vespa/metrics/countmetric.hpp b/metrics/src/vespa/metrics/countmetric.hpp index 8b5c226a5f5..dfdc2586a05 100644 --- a/metrics/src/vespa/metrics/countmetric.hpp +++ b/metrics/src/vespa/metrics/countmetric.hpp @@ -23,7 +23,13 @@ CountMetric<T, SumOnAdd>::CountMetric(const CountMetric<T, SumOnAdd>& other, } template <typename T, bool SumOnAdd> -CountMetric<T, SumOnAdd>::~CountMetric() { } +CountMetric<T, SumOnAdd>::~CountMetric() = default; + +template <typename T, bool SumOnAdd> +MetricValueClass::UP +CountMetric<T, SumOnAdd>::getValues() const { + return std::make_unique<Values>(_values.getValues()); +} template <typename T, bool SumOnAdd> CountMetric<T, SumOnAdd>& |