userver: userver/utils/statistics/pretty_format.hpp Source File
Loading...
Searching...
No Matches
pretty_format.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/utils/statistics/pretty_format.hpp
4/// @brief Statistics output in human-readable format.
5
6#include <string>
7
8#include <userver/utils/statistics/request.hpp>
9#include <userver/utils/statistics/storage.hpp>
10#include <userver/utils/statistics/writer.hpp>
11
12USERVER_NAMESPACE_BEGIN
13
14namespace utils::statistics {
15
16/// @brief Output `statistics` in a human-readable, compact format, useful for
17/// visual inspection.
18///
19/// @warning This format is unstable, we reserve the right to change it at any
20/// point. Don't use it in scripts, use utils::statistics::ToJsonFormat instead!
21///
22/// The current version of this unstable format is:
23/// @code
24/// metric-path: some-label=label-value, other-label=other-label-value\tRATE\t42
25/// @endcode
26std::string ToPrettyFormat(const Storage& statistics, const Request& statistics_request = {});
27
28std::string ToPrettyFormat(WriterFuncRef writer, const Request& statistics_request = {});
29
30} // namespace utils::statistics
31
32USERVER_NAMESPACE_END