NVIDIA DeepStream SDK API Reference

8.0 Release
prometheus::Gauge Class Reference

Detailed Description

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}
 

Constructor & Destructor Documentation

◆ Gauge() [1/4]

prometheus::Gauge::Gauge ( )
default

Create a gauge that starts at 0.

◆ Gauge() [2/4]

prometheus::Gauge::Gauge ( double  )
explicit

Create a gauge that starts at the given amount.

◆ Gauge() [3/4]

prometheus::Gauge::Gauge ( )
default

Create a gauge that starts at 0.

◆ Gauge() [4/4]

prometheus::Gauge::Gauge ( double  )
explicit

Create a gauge that starts at the given amount.

Member Function Documentation

◆ Collect() [1/2]

ClientMetric prometheus::Gauge::Collect ( ) const

Get the current value of the gauge.

Collect is called by the Registry when collecting metrics.

◆ Collect() [2/2]

ClientMetric prometheus::Gauge::Collect ( ) const

Get the current value of the gauge.

Collect is called by the Registry when collecting metrics.

◆ Decrement() [1/4]

void prometheus::Gauge::Decrement ( )

Decrement the gauge by 1.

◆ Decrement() [2/4]

void prometheus::Gauge::Decrement ( )

Decrement the gauge by 1.

◆ Decrement() [3/4]

void prometheus::Gauge::Decrement ( double  )

Decrement the gauge by the given amount.

◆ Decrement() [4/4]

void prometheus::Gauge::Decrement ( double  )

Decrement the gauge by the given amount.

◆ Increment() [1/4]

void prometheus::Gauge::Increment ( )

Increment the gauge by 1.

◆ Increment() [2/4]

void prometheus::Gauge::Increment ( )

Increment the gauge by 1.

◆ Increment() [3/4]

void prometheus::Gauge::Increment ( double  )

Increment the gauge by the given amount.

◆ Increment() [4/4]

void prometheus::Gauge::Increment ( double  )

Increment the gauge by the given amount.

◆ Set() [1/2]

void prometheus::Gauge::Set ( double  )

Set the gauge to the given value.

◆ Set() [2/2]

void prometheus::Gauge::Set ( double  )

Set the gauge to the given value.

◆ SetToCurrentTime() [1/2]

void prometheus::Gauge::SetToCurrentTime ( )

Set the gauge to the current unix time in seconds.

◆ SetToCurrentTime() [2/2]

void prometheus::Gauge::SetToCurrentTime ( )

Set the gauge to the current unix time in seconds.

◆ Value() [1/2]

double prometheus::Gauge::Value ( ) const

Get the current value of the gauge.

◆ Value() [2/2]

double prometheus::Gauge::Value ( ) const

Get the current value of the gauge.

Field Documentation

◆ metric_type

static const MetricType prometheus::Gauge::metric_type {MetricType::Gauge}
static

Definition at line 26 of file sources/includes/prometheus/gauge.h.


The documentation for this class was generated from the following file: