RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
rtctk::componentFramework::FakeComponentMetrics Struct Reference

#include <fakeComponentMetrics.hpp>

Inheritance diagram for rtctk::componentFramework::FakeComponentMetrics:
rtctk::componentFramework::ComponentMetricsIf

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

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.
 
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
 

Member Typedef Documentation

◆ CounterTypes

Defines standard performance counter types:

  • Double without timestamp
  • Unsigned 64bit integer without timestamp.
  • Signed 64bit integer without timestamp.

◆ CounterVariant

std::variant of pointers to each supported type in CounterTypes.

I.e.: std::variant<perfc::CounterDouble*, ...>

Member Function Documentation

◆ AddCounter()

virtual perfc::ScopedRegistration rtctk::componentFramework::FakeComponentMetrics::AddCounter ( CounterVariant counter,
CounterMetricInfo info )
inlineoverridevirtual

Add a counter to be included in component metrics, identified by its address, together with info to the register.

Precondition
counter must point to a valid counter object.
Note
The caller must ensure that the counter is deregistered before the counter is deleted. The returned RAII object aims to facilitate this by unregistering on destruction.
Parameters
counterPointer to any of the supported counter types.
infoA info object to be associated with counter.
Returns
RAII registration management object that automatically deregisters the counter when destroyed (or manually released). When oldb registration fails, this registration is invalid (check with isValid function).
Exceptions
MetricConflictExceptionif counter with same address has already been added before.
MetricConflictExceptionif another counter has been added with the same CounterMetricInfo::GetId().
RtctkExceptionif other exceptions occurs (nested).

Implements rtctk::componentFramework::ComponentMetricsIf.

◆ IsMonitoring()

bool rtctk::componentFramework::FakeComponentMetrics::IsMonitoring ( )
inlineoverridevirtualnoexcept

Query whether monitoring is active.

Returns
true if service is currently monitoring and publishing metrics.
false otherwise.

Implements rtctk::componentFramework::ComponentMetricsIf.

◆ RemoveCounter()

bool rtctk::componentFramework::FakeComponentMetrics::RemoveCounter ( CounterVariant counter)
inlineoverridevirtual

Remove counter from register.

Returns
true if counter was found and erased, false otherwise.

Implements rtctk::componentFramework::ComponentMetricsIf.

◆ StartMonitoring()

void rtctk::componentFramework::FakeComponentMetrics::StartMonitoring ( )
inlineoverridevirtual

Start monitoring and publishing metrics.

It has no effect if monitoring is already in-progress.

Implements rtctk::componentFramework::ComponentMetricsIf.

◆ StopMonitoring()

void rtctk::componentFramework::FakeComponentMetrics::StopMonitoring ( )
inlineoverridevirtualnoexcept

Stop monitoring.

Has no effect if no monitoring is active.

Implements rtctk::componentFramework::ComponentMetricsIf.

◆ UpdateParams()

void rtctk::componentFramework::FakeComponentMetrics::UpdateParams ( )
inlineoverridevirtual

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.


The documentation for this struct was generated from the following file: