userver
C++ Async Framework
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
Toggle main menu visibility
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
All results
metrics_storage.hpp
1
#
pragma
once
2
3
#
include
<
vector
>
4
5
#
include
<
userver
/
utils
/
statistics
/
fwd
.
hpp
>
6
#
include
<
userver
/
utils
/
statistics
/
metric_tag
.
hpp
>
7
8
USERVER_NAMESPACE_BEGIN
9
10
namespace
utils
::statistics {
11
12
/// @brief Storage of metrics registered with MetricTag<Metric>
13
/// @note The class is thread-safe. See also the note about thread-safety
14
/// on MetricTag<Metric>.
15
class
MetricsStorage
final
{
16
public
:
17
MetricsStorage();
18
19
[[nodiscard]] std::vector<Entry> RegisterIn(Storage& statistics_storage);
20
21
/// Get metric data by type
22
template
<
typename
Metric>
23
Metric&
GetMetric
(
const
MetricTag<Metric>& tag) {
24
return
impl::GetMetric<Metric>(metrics_, tag.key_);
25
}
23
Metric&
GetMetric
(
const
MetricTag<Metric>& tag) {
…
}
26
27
void
ResetMetrics();
28
29
private
:
30
impl::MetricMap metrics_;
31
};
15
class
MetricsStorage
final
{
…
};
32
33
using
MetricsStoragePtr = std::shared_ptr<MetricsStorage>;
34
35
}
// namespace utils::statistics
36
37
USERVER_NAMESPACE_END
Docs version:
v1.0
,
v2.0
,
trunk/develop
userver
utils
statistics
metrics_storage.hpp
Generated on Wed Apr 30 2025 15:55:25 for userver by
Doxygen
1.13.2