userver: userver/utils/statistics/json.hpp File Reference
Loading...
Searching...
No Matches
json.hpp File Reference

Detailed Description

Statistics output in JSON format.

Definition in file json.hpp.

Go to the source code of this file.

#include <string>
#include <userver/utils/statistics/storage.hpp>
+ Include dependency graph for json.hpp:

Namespaces

namespace  utils
 Utilities.
 

Functions

std::string utils::statistics::ToJsonFormat (const utils::statistics::Storage &statistics, const utils::statistics::Request &statistics_request={})
 

Function Documentation

◆ ToJsonFormat()

std::string utils::statistics::ToJsonFormat ( const utils::statistics::Storage & statistics,
const utils::statistics::Request & statistics_request = {} )

Output statistics in JSON format:

{
"metric-path": [
{
"type": "GAUGE",
"value": 42,
"labels": {
"some-label": "label-value",
"some-other-label": "other-label-value",
}
},
{
"type": "RATE",
"value": 43,
"labels": {
"another-label": "another-value"
}
},
]
}