userver
C++ Async Framework
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
Toggle main menu visibility
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
All results
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
Docs version:
v1.0
,
v2.0
,
trunk/develop
userver
utils
statistics
json.hpp
Generated on Thu Mar 13 2025 18:41:36 for userver by
Doxygen
1.10.0