The value of a metric. Only integer and floating-point metrics are allowed.
More...
#include <userver/utils/statistics/metric_value.hpp>
The value of a metric. Only integer and floating-point metrics are allowed.
Definition at line 17 of file metric_value.hpp.
◆ RawType
using utils::statistics::MetricValue::RawType = std::variant<std::int64_t, double, Rate> |
◆ AsFloat()
double utils::statistics::MetricValue::AsFloat |
( |
| ) |
const |
|
inline |
Retrieve the value of a floating-point metric.
- Exceptions
-
std::exception | on type mismatch. |
Definition at line 38 of file metric_value.hpp.
◆ AsInt()
std::int64_t utils::statistics::MetricValue::AsInt |
( |
| ) |
const |
|
inline |
Retrieve the value of an integer metric.
- Exceptions
-
std::exception | on type mismatch. |
Definition at line 34 of file metric_value.hpp.
◆ AsRate()
Rate utils::statistics::MetricValue::AsRate |
( |
| ) |
const |
|
inline |
Retrieve the value of a Rate metric.
- Exceptions
-
std::exception | on type mismatch. |
Definition at line 42 of file metric_value.hpp.
◆ IsRate()
bool utils::statistics::MetricValue::IsRate |
( |
| ) |
const |
|
inlinenoexcept |
◆ operator!=()
◆ operator==()
◆ Visit()
Calls visitor
with either a std::int64_t
or a double
value.
- Returns
- Whatever
visitor
returns.
Definition at line 50 of file metric_value.hpp.
The documentation for this class was generated from the following file: