12#include <userver/utils/not_null.hpp>
13#include <userver/utils/statistics/labels.hpp>
14#include <userver/utils/statistics/metric_value.hpp>
15#include <userver/utils/statistics/storage.hpp>
17USERVER_NAMESPACE_BEGIN
19namespace utils::statistics {
26class MetricQueryError
final :
public std::runtime_error {
28 using std::runtime_error::runtime_error;
37 explicit Snapshot(
const Storage& storage, std::string prefix = {}, std::vector<Label> require_labels = {});
39 Snapshot(
const Snapshot& other) =
default;
40 Snapshot(Snapshot&& other)
noexcept =
default;
48 MetricValue
SingleMetric(std::string path, std::vector<Label> require_labels = {})
const;
51 std::optional<MetricValue>
SingleMetricOptional(std::string path, std::vector<Label> require_labels = {})
const;
54 friend void PrintTo(
const Snapshot& data, std::ostream*);
57 utils::SharedRef<
const impl::SnapshotData> data_;
76void PrintTo(
const Snapshot& data, std::ostream*);
79void PrintTo(MetricValue value, std::ostream*);