From 3a5aa92006f876f5faf57bb0859b159ca841d60b Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Mon, 28 Aug 2023 15:14:39 +0000 Subject: Remove incorrect _doneInitialized check. --- metrics/src/vespa/metrics/metricmanager.cpp | 2 +- metrics/src/vespa/metrics/metricsnapshot.h | 4 ++-- metrics/src/vespa/metrics/textwriter.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'metrics') diff --git a/metrics/src/vespa/metrics/metricmanager.cpp b/metrics/src/vespa/metrics/metricmanager.cpp index 2f6fe4c6ba6..2f04096e86a 100644 --- a/metrics/src/vespa/metrics/metricmanager.cpp +++ b/metrics/src/vespa/metrics/metricmanager.cpp @@ -486,7 +486,7 @@ MetricManager::configure(const MetricLockGuard & , std::unique_ptr confi _totalMetrics = std::make_shared("All time snapshot", 0s, _activeMetrics.getMetrics(), _snapshotUnsetMetrics); _totalMetrics->reset(currentTime); } - if (_config.get() == 0 || (_config->consumer.size() != config->consumer.size())) { + if ( !_config || (_config->consumer.size() != config->consumer.size())) { _consumerConfigChanged = true; } else { for (uint32_t i=0; i<_config->consumer.size(); ++i) { diff --git a/metrics/src/vespa/metrics/metricsnapshot.h b/metrics/src/vespa/metrics/metricsnapshot.h index ae0fd92d187..e2cedf018c9 100644 --- a/metrics/src/vespa/metrics/metricsnapshot.h +++ b/metrics/src/vespa/metrics/metricsnapshot.h @@ -71,8 +71,8 @@ public: }; class MetricSnapshotSet { - uint32_t _count; // Number of times we need to add to building period - // before we have a full time window. + const uint32_t _count; // Number of times we need to add to building period + // before we have a full time window. uint32_t _builderCount; // Number of times we've currently added to the // building instance. std::unique_ptr _current; // The last full period diff --git a/metrics/src/vespa/metrics/textwriter.h b/metrics/src/vespa/metrics/textwriter.h index f23d1cf585c..7feffdf22fc 100644 --- a/metrics/src/vespa/metrics/textwriter.h +++ b/metrics/src/vespa/metrics/textwriter.h @@ -19,7 +19,7 @@ class TextWriter : public MetricVisitor { public: TextWriter(std::ostream& out, vespalib::duration period, const std::string& regex, bool verbose); - ~TextWriter(); + ~TextWriter() override; bool visitSnapshot(const MetricSnapshot&) override; void doneVisitingSnapshot(const MetricSnapshot&) override; -- cgit v1.2.3