RTC Toolkit
2.0.0
|
Component metrics interface. More...
#include <componentMetricsIf.hpp>
Public Member Functions | |
virtual | ~ComponentMetricsIf () noexcept=default |
Configuration and control | |
virtual void | StartMonitoring ()=0 |
Start monitoring and publishing metrics. More... | |
virtual void | StopMonitoring () noexcept=0 |
Stop monitoring. More... | |
virtual bool | IsMonitoring () noexcept=0 |
Query whether monitoring is active. More... | |
virtual void | UpdateParams (ComponentMetricsParams const ¶ms)=0 |
Updates parameters from params. More... | |
Thread Metrics | |
virtual void | AddThread (pid_t thread, ThreadMetricInfo info)=0 |
Add a thread to be included in component metrics. More... | |
virtual void | RemoveThread (pid_t thread)=0 |
Remove previously registered thread. More... | |
Performance Counter Metrics | |
using | CounterTypes = perfc::CounterTypes< perfc::CounterDouble, perfc::CounterU64, perfc::CounterI64 > |
Defines standard performance counter types: More... | |
using | CounterVariant = typename CounterTypes::CounterVariant |
std::variant of pointers to each supported type in CounterTypes. More... | |
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 the register. More... | |
virtual bool | RemoveCounter (CounterVariant counter)=0 |
Remove counter from register. More... | |
Component metrics interface.
Supports registration and monitoring of component metrics.
Supported types of metrics:
using rtctk::componentFramework::ComponentMetricsIf::CounterTypes = perfc::CounterTypes<perfc::CounterDouble, perfc::CounterU64, perfc::CounterI64> |
Defines standard performance counter types:
using rtctk::componentFramework::ComponentMetricsIf::CounterVariant = typename CounterTypes::CounterVariant |
std::variant of pointers to each supported type in CounterTypes.
I.e.: std::variant<perfc::CounterDouble*, ...>
|
virtualdefaultnoexcept |
|
pure virtual |
Add a counter to be included in component metrics, identified by its address, together with info to the register.
counter | Pointer to any of the supported counter types. |
info | A info object to be associated with counter. |
MetricConflictException | if counter with same address has already been added before. |
MetricConflictException | if another counter has been added with the same CounterMetricInfo::GetId(). |
RtctkException | if other exceptions occurs (nested). |
Implemented in rtctk::componentFramework::ComponentMetrics.
|
pure virtual |
Add a thread to be included in component metrics.
Thread will be automatically removed if thread is destroyed.
thread | Linux thread identifier (not std::thread/pthread). |
info | Associated information about thread. |
MetricConflictException | if thread has been added before. |
MetricConflictException | if another thread has been added with the same ThreadMetricInfo::GetId(). |
Implemented in rtctk::componentFramework::ComponentMetrics.
|
pure virtualnoexcept |
Query whether monitoring is active.
Implemented in rtctk::componentFramework::ComponentMetrics.
|
pure virtual |
Remove counter from register.
Implemented in rtctk::componentFramework::ComponentMetrics.
|
pure virtual |
Remove previously registered thread.
thread | Thread id to remove. |
Implemented in rtctk::componentFramework::ComponentMetrics.
|
pure virtual |
Start monitoring and publishing metrics.
It has no effect if monitoring is already in-progress.
Implemented in rtctk::componentFramework::ComponentMetrics.
|
pure virtualnoexcept |
Stop monitoring.
Has no effect if no monitoring is active.
Implemented in rtctk::componentFramework::ComponentMetrics.
|
pure virtual |
Updates parameters from params.
There is no guarantee that parameters are applied synchronously. For example if monitoring is already active an update of polling interval could be applied when scheduling next interval.
params | Parameters to update. Only members containing a value are considered. |
Implemented in rtctk::componentFramework::ComponentMetrics.