NVIDIA DeepStream SDK API Reference

8.0 Release
sources/includes/prometheus/gauge.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <atomic>
4 
5 #include "prometheus/client_metric.h"
6 #include "prometheus/detail/builder.h" // IWYU pragma: export
7 #include "prometheus/detail/core_export.h"
8 #include "prometheus/metric_type.h"
9 
10 namespace prometheus {
11 
25  public:
26  static const MetricType metric_type{MetricType::Gauge};
27 
29  Gauge() = default;
30 
32  explicit Gauge(double);
33 
35  void Increment();
36 
38  void Increment(double);
39 
41  void Decrement();
42 
44  void Decrement(double);
45 
47  void Set(double);
48 
50  void SetToCurrentTime();
51 
53  double Value() const;
54 
58  ClientMetric Collect() const;
59 
60  private:
61  void Change(double);
62  std::atomic<double> value_{0.0};
63 };
64 
92 PROMETHEUS_CPP_CORE_EXPORT detail::Builder<Gauge> BuildGauge();
93 
94 } // namespace prometheus
prometheus::ClientMetric
Definition: sources/includes/prometheus/client_metric.h:12
prometheus::BuildGauge
PROMETHEUS_CPP_CORE_EXPORT detail::Builder< Gauge > BuildGauge()
Return a builder to configure and register a Gauge metric.
prometheus::MetricType::Gauge
@ Gauge
prometheus::MetricType
MetricType
Definition: sources/includes/prometheus/metric_type.h:5
prometheus::Gauge
A gauge metric to represent a value that can arbitrarily go up and down.
Definition: sources/includes/prometheus/gauge.h:24
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