NVIDIA DeepStream SDK API Reference

8.0 Release
prometheus::Counter Class Reference

Detailed Description

A counter metric to represent a monotonically increasing value.

This class represents the metric type counter: https://prometheus.io/docs/concepts/metric_types/#counter

The value of the counter can only increase. Example of counters are:

  • the number of requests served
  • tasks completed
  • errors

Do not use a counter to expose a value that can decrease - instead use a Gauge.

The class is thread-safe. No concurrent call to any API of this type causes a data race.

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

Public Member Functions

 Counter ()=default
 Create a counter that starts at 0. More...
 
void Increment ()
 Increment the counter by 1. More...
 
void Increment (double)
 Increment the counter by a given amount. More...
 
void Reset ()
 Reset the counter to 0. More...
 
double Value () const
 Get the current value of the counter. More...
 
ClientMetric Collect () const
 Get the current value of the counter. More...
 
 Counter ()=default
 Create a counter that starts at 0. More...
 
void Increment ()
 Increment the counter by 1. More...
 
void Increment (double)
 Increment the counter by a given amount. More...
 
void Reset ()
 Reset the counter to 0. More...
 
double Value () const
 Get the current value of the counter. More...
 
ClientMetric Collect () const
 Get the current value of the counter. More...
 

Static Public Attributes

static const MetricType metric_type {MetricType::Counter}
 

Constructor & Destructor Documentation

◆ Counter() [1/2]

prometheus::Counter::Counter ( )
default

Create a counter that starts at 0.

◆ Counter() [2/2]

prometheus::Counter::Counter ( )
default

Create a counter that starts at 0.

Member Function Documentation

◆ Collect() [1/2]

ClientMetric prometheus::Counter::Collect ( ) const

Get the current value of the counter.

Collect is called by the Registry when collecting metrics.

◆ Collect() [2/2]

ClientMetric prometheus::Counter::Collect ( ) const

Get the current value of the counter.

Collect is called by the Registry when collecting metrics.

◆ Increment() [1/4]

void prometheus::Counter::Increment ( )

Increment the counter by 1.

◆ Increment() [2/4]

void prometheus::Counter::Increment ( )

Increment the counter by 1.

◆ Increment() [3/4]

void prometheus::Counter::Increment ( double  )

Increment the counter by a given amount.

The counter will not change if the given amount is negative.

◆ Increment() [4/4]

void prometheus::Counter::Increment ( double  )

Increment the counter by a given amount.

The counter will not change if the given amount is negative.

◆ Reset() [1/2]

void prometheus::Counter::Reset ( )

Reset the counter to 0.

◆ Reset() [2/2]

void prometheus::Counter::Reset ( )

Reset the counter to 0.

◆ Value() [1/2]

double prometheus::Counter::Value ( ) const

Get the current value of the counter.

◆ Value() [2/2]

double prometheus::Counter::Value ( ) const

Get the current value of the counter.

Field Documentation

◆ metric_type

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

Definition at line 28 of file sources/includes/prometheus/counter.h.


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