userver
C++ Async Framework
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
/
storage
.
hpp
>
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
utils
::statistics {
13
14
/// Output `statistics` in JSON format:
15
/// @code
16
/// {
17
/// "metric-path": [
18
/// {
19
/// "type": "GAUGE",
20
/// "value": 42,
21
/// "labels": {
22
/// "some-label": "label-value",
23
/// "some-other-label": "other-label-value",
24
/// }
25
/// },
26
/// {
27
/// "type": "RATE",
28
/// "value": 43,
29
/// "labels": {
30
/// "another-label": "another-value"
31
/// }
32
/// },
33
/// ]
34
/// }
35
/// @endcode
36
std::string
37
ToJsonFormat
(
const
utils
::statistics::Storage& statistics,
const
utils
::statistics::Request& statistics_request = {});
38
39
}
// namespace utils::statistics
40
41
USERVER_NAMESPACE_END
userver
utils
statistics
json.hpp
Generated on Wed Dec 4 2024 18:49:45 for userver by
Doxygen
1.10.0