userver: userver/utils/statistics/storage.hpp Source File
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
15
16USERVER_NAMESPACE_BEGIN
17
18namespace utils::statistics {
19
20using WriterFunc = std::function<void(Writer&)>;
21
22namespace impl {
23
24inline constexpr bool kCheckSubscriptionUB = utils::impl::kEnableAssert;
25
26} // namespace impl
27
35class Storage final {
36public:
37 Storage();
38
39 Storage(const Storage&) = delete;
40 Storage& operator=(const Storage&) = delete;
41 ~Storage();
42
45 void StopRegisteringExtenders();
47
66 std::string common_prefix,
67 WriterFunc func,
68 std::vector<Label> add_labels = {}
69 );
70
71private:
72 friend void DumpMetric(Writer& writer, const Storage& storage);
73
74 struct Impl;
75 std::unique_ptr<Impl> impl_;
76};
77
79void DumpMetric(Writer& writer, const Storage& storage);
80
81} // namespace utils::statistics
82
83USERVER_NAMESPACE_END