central metrics registry. You can have multiple of those and each instance will have their own set of metrics.
More...
#include <metrics_registry.h>
List of all members.
Public Member Functions |
void | Reset () |
| reset/clear all metrics
|
MetricsSnapshot | Snapshot () |
| get a snapshot of the current state of metrics
|
int | Increment (const std::string &name) |
| method to increment a metric by 1
|
int | Increment (const std::string &name, uint64_t count) |
| method to increment a metric by a given count
|
int | Decrement (const std::string &name) |
| method to decrement a metric by 1. If the result would be negative, the counter is set to 0.
|
int | Decrement (const std::string &name, uint64_t count) |
| method to decrement a metric by a given count. If the result would be negative, the counter is set to 0.
|
MetricsStore | GetCounters () |
| method to get the MetricsStore backing counters. This will return by value thus locking the mutex for the duration it takes to copy the data structure.
|
void | ResetCounters () |
| reset/clear all counters
|
int | Gauge (const std::string &name, uint64_t value) |
| method to record a gauge value
|
MetricsStore | GetGauges () |
| method to get the MetricsStore backing gauges. This will return by value thus locking the mutex for the duration it takes to copy the data structure.
|
void | ResetGauges () |
| reset/clear all gauges
|
Detailed Description
central metrics registry. You can have multiple of those and each instance will have their own set of metrics.
Member Function Documentation
method to decrement a metric by 1. If the result would be negative, the counter is set to 0.
- Parameters:
-
name | the name of the counter to decrement |
- Returns:
- int 0 on success, 1 if count is out of range
method to decrement a metric by a given count. If the result would be negative, the counter is set to 0.
- Parameters:
-
name | the name of the counter to increment |
count | integer to decrement the counter by |
- Returns:
- int 0 on success
method to record a gauge value
- Parameters:
-
name | the name of the gauge to record |
value | the value of the gauge to record |
- Returns:
- int 0 on success, 1 if value is out of range
method to get the MetricsStore backing counters. This will return by value thus locking the mutex for the duration it takes to copy the data structure.
- Returns:
- MetricsStore
method to get the MetricsStore backing gauges. This will return by value thus locking the mutex for the duration it takes to copy the data structure.
- Returns:
- MetricsStore
method to increment a metric by 1
- Parameters:
-
name | the name of the counter to increment |
- Returns:
- int 0 on success
method to increment a metric by a given count
- Parameters:
-
name | the name of the counter to increment |
count | integer to increment the counter by |
- Returns:
- int 0 on success
reset/clear all metrics
- Returns:
- void
reset/clear all counters
- Returns:
- void
reset/clear all gauges
- Returns:
- void
The documentation for this class was generated from the following files: