5#include "prometheus/client_metric.h"
6#include "prometheus/detail/builder.h"
7#include "prometheus/detail/core_export.h"
8#include "prometheus/metric_type.h"
24class PROMETHEUS_CPP_CORE_EXPORT
Gauge {
26 static const MetricType metric_type{MetricType::Gauge};
62 std::atomic<double> value_{0.0};
92PROMETHEUS_CPP_CORE_EXPORT detail::Builder<Gauge> BuildGauge();
void Increment()
Increment the gauge by 1.
Definition gauge.cc:9
Gauge()=default
Create a gauge that starts at 0.
void SetToCurrentTime()
Set the gauge to the current unixtime in seconds.
Definition gauge.cc:27
double Value() const
Get the current value of the gauge.
Definition gauge.cc:32
ClientMetric Collect() const
Get the current value of the gauge.
Definition gauge.cc:34
void Decrement()
Decrement the gauge by 1.
Definition gauge.cc:13
void Set(double)
Set the gauge to the given value.
Definition gauge.cc:17
Definition client_metric.h:12