NVIDIA DeepStream SDK API Reference

9.2 Release
sdk::metrics::AdaptingCircularBufferCounter Class Reference

Detailed Description

A circle-buffer-backed exponential counter.

The first recorded value becomes the 'base_index'. Going backwards leads to start/stop index.

This expand start/end index as it sees values.

This class is NOT thread-safe. It is expected to be behind a synchronized incrementer.

Definition at line 86 of file includes/opentelemetry/sdk/metrics/data/circular_buffer.h.

Public Member Functions

 AdaptingCircularBufferCounter (size_t max_size)
 
 AdaptingCircularBufferCounter (const AdaptingCircularBufferCounter &other)=default
 
 AdaptingCircularBufferCounter (AdaptingCircularBufferCounter &&other)=default
 
AdaptingCircularBufferCounter & operator= (const AdaptingCircularBufferCounter &other)=default
 
AdaptingCircularBufferCounter & operator= (AdaptingCircularBufferCounter &&other)=default
 
int32_t StartIndex () const
 The first index with a recording. More...
 
int32_t EndIndex () const
 The last index with a recording. More...
 
bool Empty () const
 Returns true if no recordings, false if at least one recording. More...
 
size_t MaxSize () const
 Returns the maximum number of buckets allowed in this counter. More...
 
void Clear ()
 Resets all bucket counts to zero and resets index start/end tracking. More...
 
bool Increment (int32_t index, uint64_t delta)
 Persist new data at index, incrementing by delta amount. More...
 
uint64_t Get (int32_t index) const
 Get the number of recordings for the given index. More...
 
 AdaptingCircularBufferCounter (size_t max_size)
 
 AdaptingCircularBufferCounter (const AdaptingCircularBufferCounter &other)=default
 
 AdaptingCircularBufferCounter (AdaptingCircularBufferCounter &&other)=default
 
AdaptingCircularBufferCounter & operator= (const AdaptingCircularBufferCounter &other)=default
 
AdaptingCircularBufferCounter & operator= (AdaptingCircularBufferCounter &&other)=default
 
int32_t StartIndex () const
 The first index with a recording. More...
 
int32_t EndIndex () const
 The last index with a recording. More...
 
bool Empty () const
 Returns true if no recordings, false if at least one recording. More...
 
size_t MaxSize () const
 Returns the maximum number of buckets allowed in this counter. More...
 
void Clear ()
 Resets all bucket counts to zero and resets index start/end tracking. More...
 
bool Increment (int32_t index, uint64_t delta)
 Persist new data at index, incrementing by delta amount. More...
 
uint64_t Get (int32_t index) const
 Get the number of recordings for the given index. More...
 

Constructor & Destructor Documentation

◆ AdaptingCircularBufferCounter() [1/6]

sdk::metrics::AdaptingCircularBufferCounter::AdaptingCircularBufferCounter ( size_t  max_size)
inlineexplicit

◆ AdaptingCircularBufferCounter() [2/6]

sdk::metrics::AdaptingCircularBufferCounter::AdaptingCircularBufferCounter ( const AdaptingCircularBufferCounter &  other)
default

◆ AdaptingCircularBufferCounter() [3/6]

sdk::metrics::AdaptingCircularBufferCounter::AdaptingCircularBufferCounter ( AdaptingCircularBufferCounter &&  other)
default

◆ AdaptingCircularBufferCounter() [4/6]

sdk::metrics::AdaptingCircularBufferCounter::AdaptingCircularBufferCounter ( size_t  max_size)
inlineexplicit

◆ AdaptingCircularBufferCounter() [5/6]

sdk::metrics::AdaptingCircularBufferCounter::AdaptingCircularBufferCounter ( const AdaptingCircularBufferCounter &  other)
default

◆ AdaptingCircularBufferCounter() [6/6]

sdk::metrics::AdaptingCircularBufferCounter::AdaptingCircularBufferCounter ( AdaptingCircularBufferCounter &&  other)
default

Member Function Documentation

◆ Clear() [1/2]

void sdk::metrics::AdaptingCircularBufferCounter::Clear ( )

Resets all bucket counts to zero and resets index start/end tracking.

◆ Clear() [2/2]

void sdk::metrics::AdaptingCircularBufferCounter::Clear ( )

Resets all bucket counts to zero and resets index start/end tracking.

◆ Empty() [1/2]

bool sdk::metrics::AdaptingCircularBufferCounter::Empty ( ) const
inline

Returns true if no recordings, false if at least one recording.

Definition at line 116 of file includes/opentelemetry/sdk/metrics/data/circular_buffer.h.

◆ Empty() [2/2]

bool sdk::metrics::AdaptingCircularBufferCounter::Empty ( ) const
inline

Returns true if no recordings, false if at least one recording.

Definition at line 116 of file 9.2/includes/opentelemetry/sdk/metrics/data/circular_buffer.h.

◆ EndIndex() [1/2]

int32_t sdk::metrics::AdaptingCircularBufferCounter::EndIndex ( ) const
inline

The last index with a recording.

May be negative.

Note: the returned value is not meaningful when Empty returns true.

Returns
The last index with a recording.

Definition at line 111 of file includes/opentelemetry/sdk/metrics/data/circular_buffer.h.

◆ EndIndex() [2/2]

int32_t sdk::metrics::AdaptingCircularBufferCounter::EndIndex ( ) const
inline

The last index with a recording.

May be negative.

Note: the returned value is not meaningful when Empty returns true.

Returns
The last index with a recording.

Definition at line 111 of file 9.2/includes/opentelemetry/sdk/metrics/data/circular_buffer.h.

◆ Get() [1/2]

uint64_t sdk::metrics::AdaptingCircularBufferCounter::Get ( int32_t  index) const

Get the number of recordings for the given index.

Returns
the number of recordings for the index, or 0 if the index is out of bounds.

◆ Get() [2/2]

uint64_t sdk::metrics::AdaptingCircularBufferCounter::Get ( int32_t  index) const

Get the number of recordings for the given index.

Returns
the number of recordings for the index, or 0 if the index is out of bounds.

◆ Increment() [1/2]

bool sdk::metrics::AdaptingCircularBufferCounter::Increment ( int32_t  index,
uint64_t  delta 
)

Persist new data at index, incrementing by delta amount.

Parameters
indexThe index of where to perform the incrementation.
deltaHow much to increment the index by.
Returns
success status.

◆ Increment() [2/2]

bool sdk::metrics::AdaptingCircularBufferCounter::Increment ( int32_t  index,
uint64_t  delta 
)

Persist new data at index, incrementing by delta amount.

Parameters
indexThe index of where to perform the incrementation.
deltaHow much to increment the index by.
Returns
success status.

◆ MaxSize() [1/2]

size_t sdk::metrics::AdaptingCircularBufferCounter::MaxSize ( ) const
inline

Returns the maximum number of buckets allowed in this counter.

Definition at line 121 of file 9.2/includes/opentelemetry/sdk/metrics/data/circular_buffer.h.

References sdk::metrics::AdaptingIntegerArray::Size().

◆ MaxSize() [2/2]

size_t sdk::metrics::AdaptingCircularBufferCounter::MaxSize ( ) const
inline

Returns the maximum number of buckets allowed in this counter.

Definition at line 121 of file includes/opentelemetry/sdk/metrics/data/circular_buffer.h.

References sdk::metrics::AdaptingIntegerArray::Size().

◆ operator=() [1/4]

AdaptingCircularBufferCounter& sdk::metrics::AdaptingCircularBufferCounter::operator= ( AdaptingCircularBufferCounter &&  other)
default

◆ operator=() [2/4]

AdaptingCircularBufferCounter& sdk::metrics::AdaptingCircularBufferCounter::operator= ( AdaptingCircularBufferCounter &&  other)
default

◆ operator=() [3/4]

AdaptingCircularBufferCounter& sdk::metrics::AdaptingCircularBufferCounter::operator= ( const AdaptingCircularBufferCounter &  other)
default

◆ operator=() [4/4]

AdaptingCircularBufferCounter& sdk::metrics::AdaptingCircularBufferCounter::operator= ( const AdaptingCircularBufferCounter &  other)
default

◆ StartIndex() [1/2]

int32_t sdk::metrics::AdaptingCircularBufferCounter::StartIndex ( ) const
inline

The first index with a recording.

May be negative.

Note: the returned value is not meaningful when Empty returns true.

Returns
the first index with a recording.

Definition at line 102 of file 9.2/includes/opentelemetry/sdk/metrics/data/circular_buffer.h.

◆ StartIndex() [2/2]

int32_t sdk::metrics::AdaptingCircularBufferCounter::StartIndex ( ) const
inline

The first index with a recording.

May be negative.

Note: the returned value is not meaningful when Empty returns true.

Returns
the first index with a recording.

Definition at line 102 of file includes/opentelemetry/sdk/metrics/data/circular_buffer.h.


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