Metric description. More...
#include <userver/utils/statistics/metric_tag.hpp>
Public Member Functions | |
MetricTag (const std::string &path) | |
Register metric. More... | |
std::string | GetPath () const |
Friends | |
class | MetricsStorage |
Metric description.
Use MetricTag<Metric>
for declarative style of metric registration and call MetricStorage::GetMetric<Metric>()
for accessing metric data. Please note that metrics can be accessed from multiple coroutines, so Metric
must be thread-safe (e.g. std::atomic<T>, rcu::Variable<T>, rcu::RcuMap<T>, concurrent::Variable<T>, etc.).
For custom type of Metric
you have to define method to dump your type to JSON:
Definition at line 26 of file metric_tag.hpp.
|
inlineexplicit |
Register metric.
Definition at line 29 of file metric_tag.hpp.
|
inline |
Definition at line 33 of file metric_tag.hpp.
|
friend |
Definition at line 36 of file metric_tag.hpp.