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

Statistics output in JSON format. More...

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

Go to the source code of this file.

Namespaces

namespace  utils
 Utilities.
 

Functions

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

Detailed Description

Statistics output in JSON format.

Definition in file json.hpp.

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"
}
},
]
}