userver: userver/utils/statistics/testing.hpp File Reference
Loading...
Searching...
No Matches
testing.hpp File Reference

Detailed Description

Utilities for analyzing emitted metrics in unit tests.

Definition in file testing.hpp.

Go to the source code of this file.

#include <concepts>
#include <iosfwd>
#include <optional>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <gmock/gmock.h>
#include <userver/compiler/impl/lifetime.hpp>
#include <userver/formats/json_fwd.hpp>
#include <userver/utils/function_ref.hpp>
#include <userver/utils/not_null.hpp>
#include <userver/utils/statistics/labels.hpp>
#include <userver/utils/statistics/metric_value.hpp>
#include <userver/utils/statistics/writer.hpp>
This graph shows which files directly or indirectly include this file:

Classes

class  utils::statistics::MetricQueryError
 Thrown by utils::statistics::Snapshot queries on unexpected metrics states. More...
class  utils::statistics::InvalidMetricError
 Thrown when metrics written into a snapshot are invalid. More...
class  utils::statistics::DuplicateMetricError
 Thrown when a snapshot contains two metrics with the same path and labels. More...
class  utils::statistics::DuplicateLabelError
 Thrown when one metric lists the same label name more than once. The values may differ. More...
struct  utils::statistics::MetricView
 A non-owning view of a single metric: its path, labels and value. More...
struct  utils::statistics::SnapshotBuildOptions
 Filters metrics collected by utils::statistics::Snapshot constructors. More...
struct  utils::statistics::SnapshotLoadOptions
 Prefix and labels applied to every metric in utils::statistics::Snapshot::FromJson and utils::statistics::Snapshot::FromLayeredJson. More...
class  utils::statistics::Snapshot
 A snapshot of metrics dumped via utils::statistics::Writer. More...

Namespaces

namespace  utils
 General-purpose utilities used across userver libraries.
namespace  utils::statistics
 Statistics writers, metric types, and histogram helpers.

Functions

void utils::statistics::DumpMetric (Writer &writer, const MetricView &metric)
 Writes metric through writer.
void utils::statistics::PrintTo (const Snapshot &data, std::ostream *)
 Support for gtest diagnostics for utils::statistics::Snapshot.
void utils::statistics::PrintTo (MetricValue value, std::ostream *)
 Support for gtest diagnostics for utils::statistics::MetricValue.
void utils::statistics::PrintTo (Rate value, std::ostream *)
 Support for gtest diagnostics for utils::statistics::Rate.
::testing::Matcher< Snapshot > utils::statistics::EqualsNumerically (const Snapshot &expected)
 GTest matcher for utils::statistics::Snapshot::EqualsNumerically.