#include <Metric.h>
Public Member Functions | |
| T | getValue () |
| T | getMaximum () |
| void | set (T newValue) |
| Set metric to a new value. More... | |
| void | increment () |
| Increment stored value by one. | |
| void | decrement () |
| Decrement stored value by one. | |
| void | update (T prevValue, T newValue) |
| Atomically subtract previous value from the metric and add new one. More... | |
| void | reset () |
| Resets current metric value and maximum value to zero. | |
Used for simple, thread-safe statistics such as counting resources.
| T | Data type for the metric. Common ones are uint32_t and size_t. |
|
inline |
|
inline |
|
inline |
Set metric to a new value.
Does not reset or update maximum value.
| newValue | New value. |
|
inline |
Atomically subtract previous value from the metric and add new one.
Update maximum value if needed.
| prevValue | Previous value. |
| newValue | New value. |