#include <userver/utils/statistics/metric_value.hpp>
The value of a metric.
Cheap to copy, expected to be passed around by value.
Definition at line 20 of file metric_value.hpp.
◆ RawType
| using utils::statistics::MetricValue::RawType = std::variant<std::int64_t, double, Rate, HistogramView> |
◆ MetricValue() [1/5]
| utils::statistics::MetricValue::MetricValue |
( |
| ) |
|
|
inlineconstexprnoexcept |
◆ MetricValue() [2/5]
| utils::statistics::MetricValue::MetricValue |
( |
std::int64_t | value | ) |
|
|
inlineconstexprnoexcept |
◆ MetricValue() [3/5]
| utils::statistics::MetricValue::MetricValue |
( |
double | value | ) |
|
|
inlineconstexprnoexcept |
◆ MetricValue() [4/5]
| utils::statistics::MetricValue::MetricValue |
( |
Rate | value | ) |
|
|
inlineconstexprnoexcept |
◆ MetricValue() [5/5]
| utils::statistics::MetricValue::MetricValue |
( |
HistogramView | value | ) |
|
|
inlineconstexprnoexcept |
◆ 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 52 of file metric_value.hpp.
◆ AsHistogram()
| HistogramView utils::statistics::MetricValue::AsHistogram |
( |
| ) |
const |
|
inline |
◆ 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 48 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 56 of file metric_value.hpp.
◆ IsHistogram()
| bool utils::statistics::MetricValue::IsHistogram |
( |
| ) |
const |
|
inlinenoexcept |
◆ IsRate()
| bool utils::statistics::MetricValue::IsRate |
( |
| ) |
const |
|
inlinenoexcept |
◆ Visit()
template<typename VisitorFunc>
| decltype(auto) utils::statistics::MetricValue::Visit |
( |
VisitorFunc | visitor | ) |
const |
|
inline |
Calls visitor with either a std::int64_t or a double value.
- Returns
- Whatever
visitor returns.
Definition at line 71 of file metric_value.hpp.
◆ operator!=
◆ operator==
The documentation for this class was generated from the following file: