|
RTC Toolkit 5.1.0
|
Implementation of ComponentMetricsIf. More...
#include <rtctk/componentFramework/componentMetrics.hpp>
Classes | |
| struct | Parameters |
| Runtime parameters. More... | |
Public Types | |
| using | CounterTypes |
| Defines standard performance counter types: | |
| using | CounterVariant |
| std::variant of pointers to each supported type in CounterTypes. | |
Public Types inherited from rtctk::componentFramework::ComponentMetricsIf | |
| using | CounterTypes |
| Defines standard performance counter types: | |
| using | CounterVariant = typename CounterTypes::CounterVariant |
| std::variant of pointers to each supported type in CounterTypes. | |
Public Member Functions | |
| ComponentMetrics (OldbIf &oldb, DataPointPath oldb_root, RuntimeRepoIf &rtr, DataPointPath rtr_root, log4cplus::Logger logger) | |
| ~ComponentMetrics () noexcept | |
| Destructor will automatically stop monitoring. | |
| void | StartMonitoring () override |
| Start monitoring and publishing metrics. | |
| void | StopMonitoring () noexcept override |
| Stop monitoring. | |
| bool | IsMonitoring () noexcept override |
| Query whether monitoring is active. | |
| void | UpdateParams () override |
| Reloads parameters. | |
| Parameters | GetParams () |
| virtual perfc::ScopedRegistration | AddCounter (CounterVariant counter, CounterMetricInfo info) override |
| Add a counter to be included in component metrics, identified by its address, together with info to the register. | |
| bool | RemoveCounter (CounterVariant counter) override |
| Remove counter from register. | |
Public Member Functions inherited from rtctk::componentFramework::ComponentMetricsIf | |
| virtual | ~ComponentMetricsIf () noexcept=default |
Implementation of ComponentMetricsIf.
Telemetry metrics are published to OLDB using a common root specified during construction:
Defines standard performance counter types:
std::variant of pointers to each supported type in CounterTypes.
I.e.: std::variant<perfc::CounterDouble*, ...>
|
explicit |
| oldb | Interface used to publish metrics. |
| oldb_root | Path to the root where all metrics will be published. |
| rtr | Interface used to retrieve configuration. |
| rtr_root | Path to the root where configuration should live. |
| logger | Logger instance to use. |
|
noexcept |
Destructor will automatically stop monitoring.
|
overridevirtual |
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). |
Implements rtctk::componentFramework::ComponentMetricsIf.
| ComponentMetrics::Parameters rtctk::componentFramework::ComponentMetrics::GetParams | ( | ) |
|
overridevirtualnoexcept |
Query whether monitoring is active.
Implements rtctk::componentFramework::ComponentMetricsIf.
|
overridevirtual |
Remove counter from register.
Implements rtctk::componentFramework::ComponentMetricsIf.
|
overridevirtual |
Start monitoring and publishing metrics.
It has no effect if monitoring is already in-progress.
Synchronous setup in collaboration with parent thread.
Implements rtctk::componentFramework::ComponentMetricsIf.
|
overridevirtualnoexcept |
Stop monitoring.
Has no effect if no monitoring is active.
Implements rtctk::componentFramework::ComponentMetricsIf.
|
overridevirtual |
Reloads parameters.
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.
Implements rtctk::componentFramework::ComponentMetricsIf.