userver: userver/utils/statistics/json.hpp File Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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"
}
},
]
}