Kagome
Polkadot Runtime Engine in C++17
kagome::metrics::Registry Class Referenceabstract

the class stores metrics, provides interface to create metrics and families of metrics TODO(sanblch) rethink interface to avoid error on calling registering metrics before registering family provides interfaces to register families and metrics of metric types: counter, gauge, histogram, summary More...

#include <registry.hpp>

Inheritance diagram for kagome::metrics::Registry:
Collaboration diagram for kagome::metrics::Registry:

Public Member Functions

virtual ~Registry ()=default
 
virtual void setHandler (Handler &handler)=0
 
virtual void registerCounterFamily (const std::string &name, const std::string &help="", const std::map< std::string, std::string > &labels={})=0
 
virtual void registerGaugeFamily (const std::string &name, const std::string &help="", const std::map< std::string, std::string > &labels={})=0
 
virtual void registerHistogramFamily (const std::string &name, const std::string &help="", const std::map< std::string, std::string > &labels={})=0
 
virtual void registerSummaryFamily (const std::string &name, const std::string &help="", const std::map< std::string, std::string > &labels={})=0
 
virtual CounterregisterCounterMetric (const std::string &name, const std::map< std::string, std::string > &labels={})=0
 create counter metrics object More...
 
virtual GaugeregisterGaugeMetric (const std::string &name, const std::map< std::string, std::string > &labels={})=0
 create gauge metrics object More...
 
virtual HistogramregisterHistogramMetric (const std::string &name, const std::vector< double > &bucket_boundaries, const std::map< std::string, std::string > &labels={})=0
 create histogram metrics object More...
 
virtual SummaryregisterSummaryMetric (const std::string &name, const std::vector< std::pair< double, double >> &quantiles, std::chrono::milliseconds max_age=std::chrono::seconds{60}, int age_buckets=5, const std::map< std::string, std::string > &labels={})=0
 create summary metrics object More...
 

Detailed Description

the class stores metrics, provides interface to create metrics and families of metrics TODO(sanblch) rethink interface to avoid error on calling registering metrics before registering family provides interfaces to register families and metrics of metric types: counter, gauge, histogram, summary

Parameters
nameSet the metric name.
helpSet an additional description.
labelsAssign a set of key-value pairs (= labels) to the metric. All these labels are propagated to each time series within the metric.

Definition at line 30 of file registry.hpp.

Constructor & Destructor Documentation

virtual kagome::metrics::Registry::~Registry ( )
virtualdefault

Member Function Documentation

virtual void kagome::metrics::Registry::registerCounterFamily ( const std::string &  name,
const std::string &  help = "",
const std::map< std::string, std::string > &  labels = {} 
)
pure virtual
virtual Counter* kagome::metrics::Registry::registerCounterMetric ( const std::string &  name,
const std::map< std::string, std::string > &  labels = {} 
)
pure virtual

create counter metrics object

Parameters
namethe name given at call registerCounterFamily
Returns
pointer without ownership
Note
avoid calling before registerCounterFamily

Implemented in kagome::metrics::PrometheusRegistry.

virtual void kagome::metrics::Registry::registerGaugeFamily ( const std::string &  name,
const std::string &  help = "",
const std::map< std::string, std::string > &  labels = {} 
)
pure virtual
virtual Gauge* kagome::metrics::Registry::registerGaugeMetric ( const std::string &  name,
const std::map< std::string, std::string > &  labels = {} 
)
pure virtual

create gauge metrics object

Parameters
namethe name given at call registerGaugeFamily
Returns
pointer without ownership
Note
avoid calling before registerGaugeFamily

Implemented in kagome::metrics::PrometheusRegistry.

virtual void kagome::metrics::Registry::registerHistogramFamily ( const std::string &  name,
const std::string &  help = "",
const std::map< std::string, std::string > &  labels = {} 
)
pure virtual
virtual Histogram* kagome::metrics::Registry::registerHistogramMetric ( const std::string &  name,
const std::vector< double > &  bucket_boundaries,
const std::map< std::string, std::string > &  labels = {} 
)
pure virtual

create histogram metrics object

Parameters
namethe name given at call registerHistogramFamily
bucket_boundariesa list of monotonically increasing values
Returns
pointer without ownership See https://prometheus.io/docs/practices/histograms/ for detailed explanations of histogram usage and differences to summaries.
Note
avoid calling before registerHistogramFamily

Implemented in kagome::metrics::PrometheusRegistry.

virtual void kagome::metrics::Registry::registerSummaryFamily ( const std::string &  name,
const std::string &  help = "",
const std::map< std::string, std::string > &  labels = {} 
)
pure virtual
virtual Summary* kagome::metrics::Registry::registerSummaryMetric ( const std::string &  name,
const std::vector< std::pair< double, double >> &  quantiles,
std::chrono::milliseconds  max_age = std::chrono::seconds{60},
int  age_buckets = 5,
const std::map< std::string, std::string > &  labels = {} 
)
pure virtual

create summary metrics object

Parameters
namethe name given at call registerSummaryFamily
quantilesa list of pairs denoting an error
max_ageduration of time window
age_bucketsnumber of buckets of the time window
Returns
pointer without ownership See https://prometheus.io/docs/practices/histograms/ for detailed explanations of Phi-quantiles, summary usage, and differences to histograms.
Note
avoid calling before registerSummaryFamily

Implemented in kagome::metrics::PrometheusRegistry.

virtual void kagome::metrics::Registry::setHandler ( Handler handler)
pure virtual

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