NVIDIA DeepStream SDK API Reference

8.0 Release
sources/includes/prometheus/counter.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "prometheus/client_metric.h"
4 #include "prometheus/detail/builder.h" // IWYU pragma: export
5 #include "prometheus/detail/core_export.h"
6 #include "prometheus/gauge.h"
7 #include "prometheus/metric_type.h"
8 
9 namespace prometheus {
10 
27  public:
28  static const MetricType metric_type{MetricType::Counter};
29 
31  Counter() = default;
32 
34  void Increment();
35 
39  void Increment(double);
40 
42  void Reset();
43 
45  double Value() const;
46 
50  ClientMetric Collect() const;
51 
52  private:
53  Gauge gauge_{0.0};
54 };
55 
83 PROMETHEUS_CPP_CORE_EXPORT detail::Builder<Counter> BuildCounter();
84 
85 } // namespace prometheus
prometheus::BuildCounter
PROMETHEUS_CPP_CORE_EXPORT detail::Builder< Counter > BuildCounter()
Return a builder to configure and register a Counter metric.
prometheus::ClientMetric
Definition: sources/includes/prometheus/client_metric.h:12
prometheus::MetricType
MetricType
Definition: sources/includes/prometheus/metric_type.h:5
prometheus::MetricType::Counter
@ Counter
prometheus::Gauge
A gauge metric to represent a value that can arbitrarily go up and down.
Definition: sources/includes/prometheus/gauge.h:24
prometheus::Counter
A counter metric to represent a monotonically increasing value.
Definition: sources/includes/prometheus/counter.h:26
prometheus
Definition: sources/includes/prometheus/check_names.h:8
PROMETHEUS_CPP_CORE_EXPORT
#define PROMETHEUS_CPP_CORE_EXPORT
Definition: sources/includes/prometheus/detail/core_export.h:15