Kagome
Polkadot Runtime Engine in C++17
metrics_impl.cpp
Go to the documentation of this file.
1 
7 
8 #include <prometheus/counter.h>
9 #include <prometheus/gauge.h>
10 #include <prometheus/histogram.h>
11 #include <prometheus/summary.h>
12 
13 namespace kagome::metrics {
14  PrometheusCounter::PrometheusCounter(prometheus::Counter &m) : m_(m) {}
15 
17  m_.Increment();
18  }
19 
20  void PrometheusCounter::inc(double val) {
21  m_.Increment(val);
22  }
23 
24  PrometheusGauge::PrometheusGauge(prometheus::Gauge &m) : m_(m) {}
25 
27  m_.Increment();
28  }
29 
30  void PrometheusGauge::inc(double val) {
31  m_.Increment(val);
32  }
33 
35  m_.Decrement();
36  }
37 
38  void PrometheusGauge::dec(double val) {
39  m_.Decrement(val);
40  }
41 
42  void PrometheusGauge::set(double val) {
43  m_.Set(val);
44  }
45 
46  PrometheusSummary::PrometheusSummary(prometheus::Summary &m) : m_(m) {}
47 
48  void PrometheusSummary::observe(const double value) {
49  m_.Observe(value);
50  }
51 
52  PrometheusHistogram::PrometheusHistogram(prometheus::Histogram &m) : m_(m) {}
53 
54  void PrometheusHistogram::observe(const double value) {
55  m_.Observe(value);
56  }
57 } // namespace kagome::metrics
PrometheusCounter(prometheus::Counter &m)
PrometheusSummary(prometheus::Summary &m)
void observe(const double value) override
Observe the given amount.
void observe(const double value) override
Observe the given amount.
PrometheusHistogram(prometheus::Histogram &m)
PrometheusGauge(prometheus::Gauge &m)
void inc() override
Increment the gauge by 1.
void dec() override
Decrement the gauge by 1.
void set(double val) override
Set the gauge to the given value.
void inc() override
Increment the counter by 1.