11#ifndef RTCTK_COMPONENTFRAMEWORK_COMPONENTMETRICSIF_HPP
12#define RTCTK_COMPONENTFRAMEWORK_COMPONENTMETRICSIF_HPP
17#include <perfc/perfc.hpp>
74 std::string description,
75 std::string field_name,
76 std::string unit =
"")
noexcept;
89 std::string description,
104 std::string description,
106 std::string field_name,
107 std::string unit =
"")
noexcept;
112 const std::string&
GetId() const noexcept {
119 return m_description;
145 std::string m_description;
147 std::string m_field_name;
214 perfc::
CounterTypes<perfc::CounterDouble, perfc::CounterU64, perfc::CounterI64>;
243 [[nodiscard]] virtual perfc::ScopedRegistration
256 inline static constexpr std::string
PERCENT =
"%";
258 inline static constexpr std::string
HERTZ =
"hz";
Component metrics interface.
Definition componentMetricsIf.hpp:163
typename CounterTypes::CounterVariant CounterVariant
std::variant of pointers to each supported type in CounterTypes.
Definition componentMetricsIf.hpp:220
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:213
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:48
const std::string & GetUnit() const noexcept
Definition componentMetricsIf.hpp:139
const std::string & GetDescription() const noexcept
Definition componentMetricsIf.hpp:118
const std::string & GetId() const noexcept
Definition componentMetricsIf.hpp:112
const std::string & GetFieldName() const noexcept
Definition componentMetricsIf.hpp:132
CounterMetricInfo(std::string id, std::string description) noexcept
Construct instance.
Definition componentMetricsIf.cpp:15
const InfluxTagMap & GetTagMap() const noexcept
Definition componentMetricsIf.hpp:125
Helper class for passing tags in Telegraf.
Definition influxTagMap.hpp:26
Exception indicating that a metric such as counter or thread conflicts with already known metrics.
Definition componentMetricsIf.hpp:30
RtctkException() noexcept
Definition exceptions.cpp:112
Provides macros and utilities for exception handling.
Helper class for working with InfluxDB tags.
Definition commandReplier.cpp:21
Definition componentMetricsIf.hpp:255
static constexpr std::string PERCENT
Definition componentMetricsIf.hpp:256
static constexpr std::string MICRO_SECONDS
Definition componentMetricsIf.hpp:257
static constexpr std::string HERTZ
Definition componentMetricsIf.hpp:258