6#include <userver/components/component_fwd.hpp>
7#include <userver/components/raw_component_base.hpp>
8#include <userver/utils/statistics/metrics_storage.hpp>
9#include <userver/utils/statistics/storage.hpp>
11USERVER_NAMESPACE_BEGIN
32class StatisticsStorage
final :
public RawComponentBase {
36 static constexpr std::string_view
kName =
"statistics-storage";
38 StatisticsStorage(
const ComponentConfig& config,
const ComponentContext& context);
40 ~StatisticsStorage()
override;
42 void OnAllComponentsLoaded()
override;
44 utils::statistics::Storage& GetStorage() {
return storage_; }
46 const utils::statistics::Storage& GetStorage()
const {
return storage_; }
48 utils::statistics::MetricsStoragePtr GetMetricsStorage() {
return metrics_storage_; }
50 static yaml_config::Schema GetStaticConfigSchema();
53 utils::statistics::Storage storage_;
54 utils::statistics::MetricsStoragePtr metrics_storage_;
55 std::vector<utils::statistics::Entry> metrics_storage_registration_;
59inline constexpr bool kHasValidate<StatisticsStorage> =
true;
62inline constexpr auto kConfigFileMode<StatisticsStorage> = ConfigFileMode::kNotRequired;