A gauge metric to represent a value that can arbitrarily go up and down.
The class represents the metric type gauge: https://prometheus.io/docs/concepts/metric_types/#gauge
Gauges are typically used for measured values like temperatures or current memory usage, but also "counts" that can go up and down, like the number of running processes.
The class is thread-safe. No concurrent call to any API of this type causes a data race.
Definition at line 24 of file sources/includes/prometheus/gauge.h.
Public Member Functions | |
| Gauge ()=default | |
| Create a gauge that starts at 0. More... | |
| Gauge (double) | |
| Create a gauge that starts at the given amount. More... | |
| void | Increment () |
| Increment the gauge by 1. More... | |
| void | Increment (double) |
| Increment the gauge by the given amount. More... | |
| void | Decrement () |
| Decrement the gauge by 1. More... | |
| void | Decrement (double) |
| Decrement the gauge by the given amount. More... | |
| void | Set (double) |
| Set the gauge to the given value. More... | |
| void | SetToCurrentTime () |
| Set the gauge to the current unix time in seconds. More... | |
| double | Value () const |
| Get the current value of the gauge. More... | |
| ClientMetric | Collect () const |
| Get the current value of the gauge. More... | |
| Gauge ()=default | |
| Create a gauge that starts at 0. More... | |
| Gauge (double) | |
| Create a gauge that starts at the given amount. More... | |
| void | Increment () |
| Increment the gauge by 1. More... | |
| void | Increment (double) |
| Increment the gauge by the given amount. More... | |
| void | Decrement () |
| Decrement the gauge by 1. More... | |
| void | Decrement (double) |
| Decrement the gauge by the given amount. More... | |
| void | Set (double) |
| Set the gauge to the given value. More... | |
| void | SetToCurrentTime () |
| Set the gauge to the current unix time in seconds. More... | |
| double | Value () const |
| Get the current value of the gauge. More... | |
| ClientMetric | Collect () const |
| Get the current value of the gauge. More... | |
Static Public Attributes | |
| static const MetricType | metric_type {MetricType::Gauge} |
|
default |
Create a gauge that starts at 0.
|
explicit |
Create a gauge that starts at the given amount.
|
default |
Create a gauge that starts at 0.
|
explicit |
Create a gauge that starts at the given amount.
| ClientMetric prometheus::Gauge::Collect | ( | ) | const |
Get the current value of the gauge.
Collect is called by the Registry when collecting metrics.
| ClientMetric prometheus::Gauge::Collect | ( | ) | const |
Get the current value of the gauge.
Collect is called by the Registry when collecting metrics.
| void prometheus::Gauge::Decrement | ( | ) |
Decrement the gauge by 1.
| void prometheus::Gauge::Decrement | ( | ) |
Decrement the gauge by 1.
| void prometheus::Gauge::Decrement | ( | double | ) |
Decrement the gauge by the given amount.
| void prometheus::Gauge::Decrement | ( | double | ) |
Decrement the gauge by the given amount.
| void prometheus::Gauge::Increment | ( | ) |
Increment the gauge by 1.
| void prometheus::Gauge::Increment | ( | ) |
Increment the gauge by 1.
| void prometheus::Gauge::Increment | ( | double | ) |
Increment the gauge by the given amount.
| void prometheus::Gauge::Increment | ( | double | ) |
Increment the gauge by the given amount.
| void prometheus::Gauge::Set | ( | double | ) |
Set the gauge to the given value.
| void prometheus::Gauge::Set | ( | double | ) |
Set the gauge to the given value.
| void prometheus::Gauge::SetToCurrentTime | ( | ) |
Set the gauge to the current unix time in seconds.
| void prometheus::Gauge::SetToCurrentTime | ( | ) |
Set the gauge to the current unix time in seconds.
| double prometheus::Gauge::Value | ( | ) | const |
Get the current value of the gauge.
| double prometheus::Gauge::Value | ( | ) | const |
Get the current value of the gauge.
|
static |
Definition at line 26 of file sources/includes/prometheus/gauge.h.