userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
json.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/utils/statistics/json.hpp
4
/// @brief Statistics output in JSON 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
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
utils
::
statistics
{
15
16
/// Output `statistics` in JSON format:
17
/// @code
18
/// {
19
/// "metric-path": [
20
/// {
21
/// "type": "GAUGE",
22
/// "value": 42,
23
/// "labels": {
24
/// "some-label": "label-value",
25
/// "some-other-label": "other-label-value",
26
/// }
27
/// },
28
/// {
29
/// "type": "RATE",
30
/// "value": 43,
31
/// "labels": {
32
/// "another-label": "another-value"
33
/// }
34
/// },
35
/// ]
36
/// }
37
/// @endcode
38
std::string
ToJsonFormat
(
const
Storage& statistics,
const
Request& statistics_request
=
{
}
);
39
40
std::string ToJsonFormat(
WriterFuncRef
writer,
const
Request& statistics_request
=
{
}
);
41
42
}
// namespace utils::statistics
43
44
USERVER_NAMESPACE_END
userver
utils
statistics
json.hpp
Generated on
for userver by
Doxygen
1.17.0