userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
storage.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <functional>
7
#include <memory>
8
#include <string>
9
#include <vector>
10
11
#include <
userver/utils/assert.hpp
>
12
#include <
userver/utils/resource_scopes_fwd.hpp
>
13
#include <
userver/utils/statistics/fwd.hpp
>
14
#include <
userver/utils/statistics/writer.hpp
>
15
16
USERVER_NAMESPACE_BEGIN
17
18
namespace
utils::statistics
{
19
20
using
WriterFunc = std::function<void(
Writer
&)>;
21
22
namespace
impl {
23
24
inline
constexpr
bool
kCheckSubscriptionUB = utils::impl::kEnableAssert;
25
26
}
// namespace impl
27
35
class
Storage final {
36
public
:
37
Storage();
38
39
Storage(
const
Storage&) =
delete
;
40
Storage& operator=(
const
Storage&) =
delete
;
41
~Storage();
42
45
void
StopRegisteringExtenders();
47
64
void
RegisterWriter
(
65
ResourceScopeStorage
& scopes,
66
std::string common_prefix,
67
WriterFunc func,
68
std::vector<Label> add_labels = {}
69
);
70
71
private
:
72
friend
void
DumpMetric
(
Writer
& writer,
const
Storage& storage);
73
74
struct
Impl;
75
std::unique_ptr<Impl> impl_;
76
};
77
79
void
DumpMetric
(
Writer
& writer,
const
Storage
& storage);
80
81
}
// namespace utils::statistics
82
83
USERVER_NAMESPACE_END
userver
utils
statistics
storage.hpp
Generated on
for userver by
Doxygen
1.17.0