AnyCollect  1.1.2
AnyCollect Namespace Reference

Classes

struct  Config
 Struct used to represent the JSON configuration file. More...
 
class  Controller
 
class  ControllerDelegate
 Abstract delegate of Controller. More...
 
class  Expression
 Class used to represent an expression (regex) More...
 
class  Matcher
 Class used to represent a matcher, that is a way to convert expressions matches into a metric. More...
 
class  Metric
 Class used to represent a metric object (with a name, unit, tags, a value and a timestamp) More...
 
class  SnapInterface
 
class  Source
 Class used to represent a source (file or command output) from which metrics can be matched. More...
 

Functions

void from_json (const nlohmann::json &je, Config::expression &e) noexcept
 
void from_json (const nlohmann::json &j, Config &c) noexcept
 Converts a json object into a Config object. More...
 
template<typename T , typename K >
getValue (const nlohmann::json &j, const K &key) noexcept
 Parse a JSON value of specified type from a JSON dictionary. More...
 
uint64_t parseUint (const char *&buffer) noexcept
 
void replaceMatches (std::string &str, const std::cmatch &match, const std::vector< std::string > &pathParts)
 

Function Documentation

◆ from_json() [1/2]

void AnyCollect::from_json ( const nlohmann::json &  je,
Config::expression e 
)
noexcept

Definition at line 44 of file Config.cc.

Here is the caller graph for this function:

◆ from_json() [2/2]

void AnyCollect::from_json ( const nlohmann::json &  j,
Config c 
)
noexcept

Converts a json object into a Config object.

Parameters
jjson object to parse
cConfig object to put json values into

Definition at line 58 of file Config.cc.

Here is the call graph for this function:

◆ getValue()

template<typename T , typename K >
T AnyCollect::getValue ( const nlohmann::json &  j,
const K &  key 
)
noexcept

Parse a JSON value of specified type from a JSON dictionary.

If the key is not in the JSON dictionary, the program's execution is aborted with an error.

Template Parameters
TExpected type of JSON object
KType of key
Parameters
jJSON dictionary
keykey of the JSON object to get
Returns
the extracted value with specified key and type

Definition at line 127 of file Config.h.

◆ parseUint()

uint64_t AnyCollect::parseUint ( const char *&  buffer)
inlinenoexcept

Definition at line 91 of file Matcher.cc.

Here is the caller graph for this function:

◆ replaceMatches()

void AnyCollect::replaceMatches ( std::string &  str,
const std::cmatch &  match,
const std::vector< std::string > &  pathParts 
)
inline

Definition at line 102 of file Matcher.cc.

Here is the call graph for this function:
Here is the caller graph for this function: