userver: utils::statistics::MetricsStorage Class Reference
Loading...
Searching...
No Matches
utils::statistics::MetricsStorage Class Referencefinal

#include <userver/utils/statistics/metrics_storage.hpp>

Detailed Description

Storage of metrics registered with MetricTag<Metric>

Note
The class is thread-safe. See also the note about thread-safety on MetricTag<Metric>.

Definition at line 15 of file metrics_storage.hpp.

Public Member Functions

 MetricsStorage ()
 Creates MetricStorage that considers all MetricTag<Metric> instances.
 
 MetricsStorage (const std::optional< std::vector< std::string > > &allowed_metric_paths)
 Creates MetricStorage that considers only MetricTag<Metric> instances whose paths are listed in allowed_metric_paths. If allowed_metric_paths equals std::nullopt, then all MetricTag<Metric> instances considered.
 
std::vector< EntryRegisterIn (Storage &statistics_storage)
 
template<typename Metric>
Metric & GetMetric (const MetricTag< Metric > &tag)
 Get metric data by type.
 
void ResetMetrics ()
 

Constructor & Destructor Documentation

◆ MetricsStorage()

utils::statistics::MetricsStorage::MetricsStorage ( const std::optional< std::vector< std::string > > & allowed_metric_paths)

Creates MetricStorage that considers only MetricTag<Metric> instances whose paths are listed in allowed_metric_paths. If allowed_metric_paths equals std::nullopt, then all MetricTag<Metric> instances considered.

Parameters
allowed_metric_pathspaths of MetricTag<Metric> instances that should be considered or std::nullopt if all MetricTag<Metric> instances should be considered

Member Function Documentation

◆ GetMetric()

template<typename Metric>
Metric & utils::statistics::MetricsStorage::GetMetric ( const MetricTag< Metric > & tag)
inline

Get metric data by type.

Definition at line 31 of file metrics_storage.hpp.


The documentation for this class was generated from the following file: