userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
portability_info.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/utils/statistics/portability_info.hpp
4
/// @brief Portability reports.
5
6
#
include
<
string
>
7
8
#
include
<
userver
/
utils
/
statistics
/
storage
.
hpp
>
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
utils
::
statistics
{
13
14
formats::
json
::
Value
Serialize(
const
std::vector<Label>& labels, formats::
serialize
::
To
<formats::
json
::
Value
>);
15
16
struct
Warning
{
17
std::string error_message;
18
std::string path;
19
std::vector<Label> labels;
20
};
21
22
formats::
json
::
Value
Serialize(
const
Warning
& entry, formats::
serialize
::
To
<formats::
json
::
Value
>);
23
24
enum
class
WarningCode {
25
kInf,
26
kNan,
27
kHistogramBucketsCount,
28
29
kLabelsCount,
30
31
kReservedLabelApplication,
32
kReservedLabelCluster,
33
kReservedLabelGroup,
34
kReservedLabelHost,
35
kReservedLabelProject,
36
kReservedLabelSensor,
37
kReservedLabelService,
38
39
kLabelNameLength,
40
kLabelValueLength,
41
kPathLength,
42
kLabelNameMismatch,
43
};
44
45
std::string_view ToString(WarningCode code);
46
47
using
PortabilityWarnings = std::unordered_map<WarningCode, std::vector<
Warning
>>;
48
49
/// JSON serialization for the PortabilityInfo in the following format:
50
/// @code
51
/// {
52
/// "warning_code": [
53
/// {
54
/// "error_message": "Human readable message",
55
/// "path": "foo-bar",
56
/// "labels": {
57
/// "some-label": "label-value",
58
/// "some-other-label": "other-label-value",
59
/// }
60
/// }
61
/// ],
62
/// "another_error_id": [
63
/// {
64
/// "path": "foo.bar",
65
/// "labels": {
66
/// "another-label": "another-value"
67
/// }
68
/// },
69
/// ]
70
/// }
71
/// @endcode
72
formats::
json
::
Value
Serialize
(
const
PortabilityWarnings& info, formats::
serialize
::
To
<formats::
json
::
Value
>);
73
74
/// Output portability info for `statistics`.
75
/// @see @ref scripts/docs/en/userver/functional_testing.md
76
PortabilityWarnings
GetPortabilityWarnings
(
77
const
utils
::
statistics
::Storage& statistics,
78
const
utils
::
statistics
::Request& request
79
);
80
81
}
// namespace utils::statistics
82
83
USERVER_NAMESPACE_END
userver
utils
statistics
portability_info.hpp
Generated on
for userver by
Doxygen
1.17.0