userver
C++ Async Framework
Toggle main menu visibility
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
/// @ingroup userver_universal
6
7
#
include
<
string
>
8
9
#
include
<
userver
/
utils
/
statistics
/
request
.
hpp
>
10
#
include
<
userver
/
utils
/
statistics
/
visit
.
hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
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
26
std::string
ToPrettyFormat
(
WriterFuncRef
writer,
const
Request& statistics_request
=
{
}
);
27
28
/// @overload
29
std
::
string
ToPrettyFormat
(
const
HasWriterSupport
auto
&
metric
,
const
Request
&
statistics_request
= {}) {
30
return
ToPrettyFormat
([&
metric
](
Writer
&
writer
) {
writer
=
metric
; },
statistics_request
);
31
}
32
33
}
// namespace utils::statistics
34
35
USERVER_NAMESPACE_END
userver
utils
statistics
pretty_format.hpp
Generated on
for userver by
Doxygen
1.17.0