diff --git a/src/telemetry/Counter.cc b/src/telemetry/Counter.cc index 88f9ec74c2..9a8aa5e5bb 100644 --- a/src/telemetry/Counter.cc +++ b/src/telemetry/Counter.cc @@ -73,20 +73,20 @@ auto opaque(NativeDblCounter* ptr) template auto withNativeLabels(Span xs, F continuation) { - if (xs.size() <= 10) + if ( xs.size() <= 10 ) { ct::label_view buf[10]={ {{},{}}, {{},{}}, {{},{}}, {{},{}}, {{},{}}, {{},{}}, {{},{}}, {{},{}}, {{},{}}, {{},{}}, }; - for (size_t index = 0; index < xs.size(); ++index) + for ( size_t index = 0; index < xs.size(); ++index ) buf[index] = ct::label_view{xs[index].first, xs[index].second}; return continuation(Span{buf, xs.size()}); } else { std::vector buf; - for (auto x : xs) + for ( auto x : xs ) buf.emplace_back(x.first, x.second); return continuation(Span{buf}); } @@ -118,7 +118,6 @@ int64_t IntCounter::value() const noexcept IntCounterFamily::IntCounterFamily(Impl* ptr) : MetricFamily(upcast(ptr)) { - // nop } IntCounter IntCounterFamily::getOrAdd(Span labels) @@ -149,7 +148,6 @@ double DblCounter::value() const noexcept DblCounterFamily::DblCounterFamily(Impl* ptr) : MetricFamily(upcast(ptr)) { - // nop } DblCounter DblCounterFamily::getOrAdd(Span labels) diff --git a/src/telemetry/Counter.h b/src/telemetry/Counter.h index 259726b6ac..57d2ef38e7 100644 --- a/src/telemetry/Counter.h +++ b/src/telemetry/Counter.h @@ -61,7 +61,6 @@ public: private: explicit IntCounter(Impl* ptr) noexcept : pimpl(ptr) { - // nop } Impl* pimpl; @@ -154,7 +153,6 @@ public: private: explicit DblCounter(Impl* ptr) noexcept : pimpl(ptr) { - // nop } Impl* pimpl; diff --git a/src/telemetry/Gauge.cc b/src/telemetry/Gauge.cc index 2d9616b10c..e7a4322634 100644 --- a/src/telemetry/Gauge.cc +++ b/src/telemetry/Gauge.cc @@ -73,20 +73,20 @@ auto opaque(NativeDblGauge* ptr) template auto withNativeLabels(Span xs, F continuation) { - if (xs.size() <= 10) + if ( xs.size() <= 10 ) { ct::label_view buf[10]={ {{},{}}, {{},{}}, {{},{}}, {{},{}}, {{},{}}, {{},{}}, {{},{}}, {{},{}}, {{},{}}, {{},{}}, }; - for (size_t index = 0; index < xs.size(); ++index) + for ( size_t index = 0; index < xs.size(); ++index ) buf[index] = ct::label_view{xs[index].first, xs[index].second}; return continuation(Span{buf, xs.size()}); } else { std::vector buf; - for (auto x : xs) + for ( auto x : xs ) buf.emplace_back(x.first, x.second); return continuation(Span{buf}); } @@ -133,7 +133,6 @@ int64_t IntGauge::value() const noexcept IntGaugeFamily::IntGaugeFamily(Impl* ptr) : MetricFamily(upcast(ptr)) { - // nop } IntGauge IntGaugeFamily::getOrAdd(Span labels) @@ -174,7 +173,6 @@ double DblGauge::value() const noexcept DblGaugeFamily::DblGaugeFamily(Impl* ptr) : MetricFamily(upcast(ptr)) { - // nop } DblGauge DblGaugeFamily::getOrAdd(Span labels) diff --git a/src/telemetry/Gauge.h b/src/telemetry/Gauge.h index 2f83b75462..36b0d5855c 100644 --- a/src/telemetry/Gauge.h +++ b/src/telemetry/Gauge.h @@ -77,7 +77,6 @@ public: private: explicit IntGauge(Impl* ptr) noexcept : pimpl(ptr) { - // nop } Impl* pimpl; @@ -180,7 +179,6 @@ public: private: explicit DblGauge(Impl* ptr) noexcept : pimpl(ptr) { - // nop } Impl* pimpl; diff --git a/src/telemetry/Manager.cc b/src/telemetry/Manager.cc index 4ba9535ca1..1830a36146 100644 --- a/src/telemetry/Manager.cc +++ b/src/telemetry/Manager.cc @@ -63,17 +63,17 @@ auto opaque(NativeDblGaugeFamily* ptr) template auto withNative(Span xs, F continuation) { - if (xs.size() <= 10) + if ( xs.size() <= 10 ) { caf::string_view buf[10]; - for (size_t index = 0; index < xs.size(); ++index) + for ( size_t index = 0; index < xs.size(); ++index ) buf[index] = xs[index]; return continuation(Span{buf, xs.size()}); } else { std::vector buf; - for (auto x : xs) + for ( auto x : xs ) buf.emplace_back(x); return continuation(Span{buf}); } @@ -81,6 +81,10 @@ auto withNative(Span xs, F continuation) } // namespace +Manager::~Manager() + { + } + IntCounterFamily Manager::intCounterFam(std::string_view prefix, std::string_view name, Span labels, @@ -150,7 +154,7 @@ template auto toVector(zeek::Span xs) { std::vector> result; - for (auto&& x : xs) + for ( auto&& x : xs ) result.emplace_back(x); return result; } diff --git a/src/telemetry/Manager.h b/src/telemetry/Manager.h index 32f08f89b2..9c9783878b 100644 --- a/src/telemetry/Manager.h +++ b/src/telemetry/Manager.h @@ -22,13 +22,14 @@ public: explicit Manager(Impl* ptr) : pimpl(ptr) { - //nop } Manager(const Manager&) = delete; Manager& operator=(const Manager&) = delete; + virtual ~Manager(); + /** * @returns a counter metric family. Creates the family lazily if necessary. * @param prefix The prefix (namespace) this family belongs to. @@ -255,14 +256,14 @@ private: template static void withLabelNames(Span xs, F continuation) { - if (xs.size() <= 10) { + if ( xs.size() <= 10 ) { std::string_view buf[10]; - for (size_t index = 0; index < xs.size(); ++index) + for ( size_t index = 0; index < xs.size(); ++index ) buf[index] = xs[index].first; return continuation(Span{buf, xs.size()}); } else { std::vector buf; - for (auto x : xs) + for ( auto x : xs ) buf.emplace_back(x.first, x.second); return continuation(Span{buf}); } @@ -275,6 +276,8 @@ private: namespace zeek { +// @note for technically reasons (CAF dependency), this variable gets +// initialized in broker/Manager.cc. extern telemetry::Manager* telemetry_mgr; } // namespace zeek diff --git a/src/telemetry/MetricFamily.h b/src/telemetry/MetricFamily.h index 1f79d73907..403e1aa90d 100644 --- a/src/telemetry/MetricFamily.h +++ b/src/telemetry/MetricFamily.h @@ -68,7 +68,6 @@ public: protected: explicit MetricFamily(Impl* ptr) : pimpl(ptr) { - // nop } Impl* pimpl;