12#ifndef RTCTK_COMPONENTFRAMEWORK_COMPONENTMETRICSIF_HPP
13#define RTCTK_COMPONENTFRAMEWORK_COMPONENTMETRICSIF_HPP
18#include <perfc/perfc.hpp>
75 std::string description,
76 std::string field_name,
77 std::string unit =
"")
noexcept;
90 std::string description,
105 std::string description,
107 std::string field_name,
108 std::string unit =
"")
noexcept;
113 const std::string&
GetId() const noexcept {
120 return m_description;
146 std::string m_description;
148 std::string m_field_name;
215 perfc::
CounterTypes<perfc::CounterDouble, perfc::CounterU64, perfc::CounterI64>;
244 [[nodiscard]] virtual perfc::ScopedRegistration
257 inline static constexpr std::string
PERCENT =
"%";
259 inline static constexpr std::string
HERTZ =
"hz";
Component metrics interface.
Definition componentMetricsIf.hpp:164
typename CounterTypes::CounterVariant CounterVariant
std::variant of pointers to each supported type in CounterTypes.
Definition componentMetricsIf.hpp:221
virtual void UpdateParams()=0
Reloads parameters.
virtual void StopMonitoring() noexcept=0
Stop monitoring.
virtual bool IsMonitoring() noexcept=0
Query whether monitoring is active.
perfc::CounterTypes< perfc::CounterDouble, perfc::CounterU64, perfc::CounterI64 > CounterTypes
Defines standard performance counter types:
Definition componentMetricsIf.hpp:214
virtual void StartMonitoring()=0
Start monitoring and publishing metrics.
virtual ~ComponentMetricsIf() noexcept=default
virtual perfc::ScopedRegistration AddCounter(CounterVariant counter, CounterMetricInfo info)=0
Add a counter to be included in component metrics, identified by its address, together with info to t...
virtual bool RemoveCounter(CounterVariant counter)=0
Remove counter from register.
Defines auxiliary information associated with each counter registered with ComponentMetricsIf.
Definition componentMetricsIf.hpp:49
const std::string & GetUnit() const noexcept
Definition componentMetricsIf.hpp:140
const std::string & GetDescription() const noexcept
Definition componentMetricsIf.hpp:119
const std::string & GetId() const noexcept
Definition componentMetricsIf.hpp:113
const std::string & GetFieldName() const noexcept
Definition componentMetricsIf.hpp:133
CounterMetricInfo(std::string id, std::string description) noexcept
Construct instance.
Definition componentMetricsIf.cpp:16
const InfluxTagMap & GetTagMap() const noexcept
Definition componentMetricsIf.hpp:126
Helper class for passing tags in Telegraf.
Definition influxTagMap.hpp:27
Exception indicating that a metric such as counter or thread conflicts with already known metrics.
Definition componentMetricsIf.hpp:31
RtctkException() noexcept
Definition exceptions.cpp:113
Provides macros and utilities for exception handling.
Helper class for working with InfluxDB tags.
Definition commandReplier.cpp:22
Definition componentMetricsIf.hpp:256
static constexpr std::string PERCENT
Definition componentMetricsIf.hpp:257
static constexpr std::string MICRO_SECONDS
Definition componentMetricsIf.hpp:258
static constexpr std::string HERTZ
Definition componentMetricsIf.hpp:259