RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
rtctk::componentFramework::CounterMetricInfo Class Reference

Defines auxiliary information associated with each counter registered with ComponentMetricsIf. More...

#include <rtctk/componentFramework/componentMetricsIf.hpp>

Public Member Functions

 CounterMetricInfo (std::string id, std::string description) noexcept
 Construct instance.
 
 CounterMetricInfo (std::string id, std::string description, std::string field_name, std::string unit="") noexcept
 Construct instance.
 
 CounterMetricInfo (std::string id, std::string description, InfluxTagMap tag_map) noexcept
 Construct instance.
 
 CounterMetricInfo (std::string id, std::string description, InfluxTagMap tag_map, std::string field_name, std::string unit="") noexcept
 Construct instance.
 
const std::string & GetId () const noexcept
 
const std::string & GetDescription () const noexcept
 
const InfluxTagMapGetTagMap () const noexcept
 
const std::string & GetFieldName () const noexcept
 
const std::string & GetUnit () const noexcept
 

Detailed Description

Defines auxiliary information associated with each counter registered with ComponentMetricsIf.

Properties:

  • Id: String in the character class [0-9a-z] associates uniquely a logical counter instance.
  • Description: String describing what the counter value represents.
  • InfluxTagMap: map of strings for defition of tags (InfluxDB)
  • FieldName: name for the field where the value will be saved (InfluxDB)

Constructor & Destructor Documentation

◆ CounterMetricInfo() [1/4]

rtctk::componentFramework::CounterMetricInfo::CounterMetricInfo ( std::string id,
std::string description )
explicitnoexcept

Construct instance.

This overload is intended for the simplest case where the metric has no associated InfluxDB tags and no explicitly defined field name. The field name is automatically set to the metric ID.

Parameters
idcounter identifier.
descriptioncounter description.

◆ CounterMetricInfo() [2/4]

rtctk::componentFramework::CounterMetricInfo::CounterMetricInfo ( std::string id,
std::string description,
std::string field_name,
std::string unit = "" )
explicitnoexcept

Construct instance.

Use this overload when the metric should be written under a different InfluxDB field name than its ID. No tags are provided in this variant.

Parameters
idcounter identifier.
descriptioncounter description.
field_namename of the field used when writing data to InfluxDB.
unitabbreviated physical unit e.g. hz for hertz.

◆ CounterMetricInfo() [3/4]

rtctk::componentFramework::CounterMetricInfo::CounterMetricInfo ( std::string id,
std::string description,
InfluxTagMap tag_map )
explicitnoexcept

Construct instance.

This overload allows user to add a tags (InfluxDB tags). Since the user does not provide a field name, it is automatically set to id.

Parameters
idcounter identifier.
descriptioncounter description.
tag_mapmap of tags: string–string pairs for InfluxDB.

◆ CounterMetricInfo() [4/4]

rtctk::componentFramework::CounterMetricInfo::CounterMetricInfo ( std::string id,
std::string description,
InfluxTagMap tag_map,
std::string field_name,
std::string unit = "" )
explicitnoexcept

Construct instance.

Use this overload when both tags and a custom InfluxDB field name are required.

Parameters
idcounter identifier.
descriptioncounter description.
tag_mapmap of tags: string–string pairs for InfluxDB.
field_namename of the field used when writing data to InfluxDB.
unitabbreviated physical unit e.g. hz for hertz.

Member Function Documentation

◆ GetDescription()

const std::string & rtctk::componentFramework::CounterMetricInfo::GetDescription ( ) const
inlinenoexcept
Returns
counter description.

◆ GetFieldName()

const std::string & rtctk::componentFramework::CounterMetricInfo::GetFieldName ( ) const
inlinenoexcept
Returns
name of field for InfluxDB.

◆ GetId()

const std::string & rtctk::componentFramework::CounterMetricInfo::GetId ( ) const
inlinenoexcept
Returns
counter identifier.

◆ GetTagMap()

const InfluxTagMap & rtctk::componentFramework::CounterMetricInfo::GetTagMap ( ) const
inlinenoexcept
Returns
tags for InfluxDB.

◆ GetUnit()

const std::string & rtctk::componentFramework::CounterMetricInfo::GetUnit ( ) const
inlinenoexcept
Returns
unit for InfluxDB and OLDB metadata.

The documentation for this class was generated from the following files: