TARAXA
Loading...
Searching...
No Matches
taraxa::metrics::MetricsGroup Class Reference

#include <metrics_group.hpp>

Public Types

using MetricGetter = std::function< double()>
 
using MetricUpdater = std::function< void()>
 

Public Member Functions

 MetricsGroup (std::shared_ptr< prometheus::Registry > registry)
 
virtual ~MetricsGroup ()=default
 
template<class Type >
prometheus::Family< Type > & addMetric (const std::string &name, const std::string &help)
 template method to add metric family. Family is a metric, but additional labels could be specified for it. Labels if optional.
 
void updateData ()
 method that is used to call registered updaters for the specific class
 

Protected Attributes

std::shared_ptr< prometheus::Registry > registry_
 
std::vector< MetricUpdaterupdaters_
 

Member Typedef Documentation

◆ MetricGetter

using taraxa::metrics::MetricsGroup::MetricGetter = std::function<double()>

◆ MetricUpdater

using taraxa::metrics::MetricsGroup::MetricUpdater = std::function<void()>

Constructor & Destructor Documentation

◆ MetricsGroup()

taraxa::metrics::MetricsGroup::MetricsGroup ( std::shared_ptr< prometheus::Registry >  registry)
inline

◆ ~MetricsGroup()

virtual taraxa::metrics::MetricsGroup::~MetricsGroup ( )
virtualdefault

Member Function Documentation

◆ addMetric()

template<class Type >
prometheus::Family< Type > & taraxa::metrics::MetricsGroup::addMetric ( const std::string &  name,
const std::string &  help 
)
inline

template method to add metric family. Family is a metric, but additional labels could be specified for it. Labels if optional.

Template Parameters
Typetype of prometheus metric that should be added
Parameters
namemetric name
helphelp string for metric(description)
Returns
Family<T>

◆ updateData()

void taraxa::metrics::MetricsGroup::updateData ( )
inline

method that is used to call registered updaters for the specific class

Member Data Documentation

◆ registry_

std::shared_ptr<prometheus::Registry> taraxa::metrics::MetricsGroup::registry_
protected

◆ updaters_

std::vector<MetricUpdater> taraxa::metrics::MetricsGroup::updaters_
protected

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