Kagome
Polkadot Runtime Engine in C++17
metrics_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_METRICS_IMPL_PROMETHEUS_METRICS_IMPL_HPP
7 #define KAGOME_CORE_METRICS_IMPL_PROMETHEUS_METRICS_IMPL_HPP
8 
9 #include "metrics/metrics.hpp"
10 
11 namespace prometheus {
12  class Counter;
13  class Gauge;
14  class Summary;
15  class Histogram;
16 } // namespace prometheus
17 
18 namespace kagome::metrics {
19  class PrometheusCounter : public Counter {
20  friend class PrometheusRegistry;
21  prometheus::Counter &m_;
22 
23  public:
24  PrometheusCounter(prometheus::Counter &m);
25 
26  public:
27  void inc() override;
28  void inc(double val) override;
29  };
30 
31  class PrometheusGauge : public Gauge {
32  friend class PrometheusRegistry;
33  prometheus::Gauge &m_;
34 
35  public:
36  PrometheusGauge(prometheus::Gauge &m);
37 
38  public:
39  void inc() override;
40  void inc(double val) override;
41  void dec() override;
42  void dec(double val) override;
43  void set(double val) override;
44  };
45 
46  class PrometheusSummary : public Summary {
47  friend class PrometheusRegistry;
48  prometheus::Summary &m_;
49 
50  public:
51  PrometheusSummary(prometheus::Summary &m);
52 
53  public:
54  void observe(const double value) override;
55  };
56 
57  class PrometheusHistogram : public Histogram {
58  friend class PrometheusRegistry;
59  prometheus::Histogram &m_;
60 
61  public:
62  PrometheusHistogram(prometheus::Histogram &m);
63 
64  public:
65  void observe(const double value) override;
66  };
67 } // namespace kagome::metrics
68 
69 #endif // KAGOME_CORE_METRICS_IMPL_PROMETHEUS_METRICS_IMPL_HPP
A histogram metric to represent aggregatable distributions of events.
Definition: metrics.hpp:108
A summary metric samples observations over a sliding window of time.
Definition: metrics.hpp:91
A gauge metric to represent a value that can arbitrarily go up and down.
Definition: metrics.hpp:49
A counter metric to represent a monotonically increasing value.
Definition: metrics.hpp:27