TARAXA
metrics_group.hpp File Reference
#include <prometheus/gauge.h>
#include <prometheus/registry.h>
#include <iostream>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  taraxa::metrics::MetricsGroup
 

Namespaces

 taraxa
 
 taraxa::metrics
 

Macros

#define ADD_GAUGE_METRIC(method, name, description)
 add method that is setting specific gauge metric. More...
 
#define ADD_UPDATER_METHOD(method)
 add updater method. This is used to store lambda function that updates metric, so we can update it periodically Passed method should be added first More...
 
#define ADD_GAUGE_METRIC_WITH_UPDATER(method, name, description)
 combines ADD_UPDATER_METHOD and ADD_GAUGE_METRIC More...
 

Typedefs

using taraxa::metrics::SharedMetricsGroup = std::shared_ptr< MetricsGroup >
 

Macro Definition Documentation

◆ ADD_GAUGE_METRIC

#define ADD_GAUGE_METRIC (   method,
  name,
  description 
)
Value:
void method(double v) { \
static auto& label = addMetric<prometheus::Gauge>(group_name + "_" + name, description).Add({}); \
label.Set(v); \
}

add method that is setting specific gauge metric.

◆ ADD_GAUGE_METRIC_WITH_UPDATER

#define ADD_GAUGE_METRIC_WITH_UPDATER (   method,
  name,
  description 
)
Value:
ADD_GAUGE_METRIC(method, name, description) \
ADD_UPDATER_METHOD(method)
#define ADD_GAUGE_METRIC(method, name, description)
add method that is setting specific gauge metric.
Definition: metrics_group.hpp:13

combines ADD_UPDATER_METHOD and ADD_GAUGE_METRIC

◆ ADD_UPDATER_METHOD

#define ADD_UPDATER_METHOD (   method)
Value:
void method##Updater(MetricGetter getter) { \
updaters_.push_back([this, getter]() { method(getter()); }); \
}

add updater method. This is used to store lambda function that updates metric, so we can update it periodically Passed method should be added first