userver: userver/utils/statistics/portability_info.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
portability_info.hpp File Reference

Portability reports. More...

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

Go to the source code of this file.

Classes

struct  utils::statistics::Warning
 

Namespaces

namespace  utils
 Utilities.
 

Typedefs

using utils::statistics::PortabilityWarnings = std::unordered_map< WarningCode, std::vector< Warning > >
 

Enumerations

enum class  WarningCode {
  kInf ,
  kNan ,
  kLabelsCount ,
  kReservedLabelApplication ,
  kReservedLabelCluster ,
  kReservedLabelGroup ,
  kReservedLabelHost ,
  kReservedLabelProject ,
  kReservedLabelSensor ,
  kReservedLabelService ,
  kLabelNameLength ,
  kLabelValueLength ,
  kPathLength ,
  kLabelNameMismatch
}
 

Functions

formats::json::Value utils::statistics::Serialize (const std::vector< Label > &labels, formats::serialize::To< formats::json::Value >)
 
formats::json::Value utils::statistics::Serialize (const Warning &entry, formats::serialize::To< formats::json::Value >)
 
std::string_view utils::statistics::ToString (WarningCode code)
 
formats::json::Value utils::statistics::Serialize (const PortabilityWarnings &info, formats::serialize::To< formats::json::Value >)
 
PortabilityWarnings utils::statistics::GetPortabilityWarnings (const utils::statistics::Storage &statistics, const utils::statistics::Request &request)
 

Detailed Description

Portability reports.

Definition in file portability_info.hpp.

Typedef Documentation

◆ PortabilityWarnings

using utils::statistics::PortabilityWarnings = typedef std::unordered_map<WarningCode, std::vector<Warning> >

Definition at line 47 of file portability_info.hpp.

Enumeration Type Documentation

◆ WarningCode

enum class utils::statistics::WarningCode
strong

Definition at line 26 of file portability_info.hpp.

Function Documentation

◆ GetPortabilityWarnings()

PortabilityWarnings utils::statistics::GetPortabilityWarnings ( const utils::statistics::Storage statistics,
const utils::statistics::Request request 
)

Output portability info for statistics.

See also
Functional service tests (testsuite)

◆ Serialize()

formats::json::Value utils::statistics::Serialize ( const PortabilityWarnings &  info,
formats::serialize::To< formats::json::Value  
)

JSON serilization for the PortabilityInfo in the following format:

{
"warning_code": [
{
"error_message": "Human readable message",
"path": "foo-bar",
"labels": {
"some-label": "label-value",
"some-other-label": "other-label-value",
}
}
],
"another_error_id": [
{
"path": "foo.bar",
"labels": {
"another-label": "another-value"
}
},
]
}