#include <userver/utils/statistics/testing.hpp>
Filters metrics collected by utils::statistics::Snapshot constructors.
Definition at line 80 of file testing.hpp.
Public Attributes | |
| std::optional< std::string > | require_prefix {} |
| std::vector< Label > | require_labels {} |
| Keep metrics containing all these labels; additional labels are allowed. | |
| bool | sliced {true} |
| std::vector<Label> utils::statistics::SnapshotBuildOptions::require_labels {} |
Keep metrics containing all these labels; additional labels are allowed.
Definition at line 92 of file testing.hpp.
| std::optional<std::string> utils::statistics::SnapshotBuildOptions::require_prefix {} |
Keep metrics whose full path starts with this prefix; do not prepend it to emitted paths. When utils::statistics::SnapshotBuildOptions::sliced is true, a nonempty prefix must match the whole path or end at a dot-separated segment boundary: "api" matches "api" and "api.requests", but not "apis". std::nullopt keeps all paths. An explicitly empty string is rejected with std::invalid_argument. When utils::statistics::SnapshotBuildOptions::sliced is true, a trailing . is also rejected with std::invalid_argument. When utils::statistics::SnapshotBuildOptions::sliced is false, use raw string prefix matching: "api" also matches "apis".
Definition at line 89 of file testing.hpp.
| bool utils::statistics::SnapshotBuildOptions::sliced {true} |
Remove utils::statistics::SnapshotBuildOptions::require_prefix and utils::statistics::SnapshotBuildOptions::require_labels from selected metrics before storing them. Also remove one separating . after the prefix. An exact prefix match becomes an empty path. A path equal to the prefix followed by just . is rejected with std::invalid_argument: for example, "api." sliced by "api" would become indistinguishable from the exact path "api". Empty inner segments, such as in "api..requests", remain allowed. If false, use raw string prefix filtering and preserve full paths and all labels.
Definition at line 101 of file testing.hpp.