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... | |
|
inlineexplicit |
Definition at line 89 of file includes/opentelemetry/sdk/metrics/data/circular_buffer.h.
|
default |
|
default |
|
inlineexplicit |
Definition at line 89 of file 9.2/includes/opentelemetry/sdk/metrics/data/circular_buffer.h.
|
default |
|
default |
| void sdk::metrics::AdaptingCircularBufferCounter::Clear | ( | ) |
Resets all bucket counts to zero and resets index start/end tracking.
| void sdk::metrics::AdaptingCircularBufferCounter::Clear | ( | ) |
Resets all bucket counts to zero and resets index start/end tracking.
|
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.
|
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.
|
inline |
The last index with a recording.
May be negative.
Note: the returned value is not meaningful when Empty returns true.
Definition at line 111 of file includes/opentelemetry/sdk/metrics/data/circular_buffer.h.
|
inline |
The last index with a recording.
May be negative.
Note: the returned value is not meaningful when Empty returns true.
Definition at line 111 of file 9.2/includes/opentelemetry/sdk/metrics/data/circular_buffer.h.
| uint64_t sdk::metrics::AdaptingCircularBufferCounter::Get | ( | int32_t | index | ) | const |
Get the number of recordings for the given index.
| uint64_t sdk::metrics::AdaptingCircularBufferCounter::Get | ( | int32_t | index | ) | const |
Get the number of recordings for the given index.
| bool sdk::metrics::AdaptingCircularBufferCounter::Increment | ( | int32_t | index, |
| uint64_t | delta | ||
| ) |
Persist new data at index, incrementing by delta amount.
| index | The index of where to perform the incrementation. |
| delta | How much to increment the index by. |
| bool sdk::metrics::AdaptingCircularBufferCounter::Increment | ( | int32_t | index, |
| uint64_t | delta | ||
| ) |
Persist new data at index, incrementing by delta amount.
| index | The index of where to perform the incrementation. |
| delta | How much to increment the index by. |
|
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().
|
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().
|
default |
|
default |
|
default |
|
default |
|
inline |
The first index with a recording.
May be negative.
Note: the returned value is not meaningful when Empty returns true.
Definition at line 102 of file 9.2/includes/opentelemetry/sdk/metrics/data/circular_buffer.h.
|
inline |
The first index with a recording.
May be negative.
Note: the returned value is not meaningful when Empty returns true.
Definition at line 102 of file includes/opentelemetry/sdk/metrics/data/circular_buffer.h.