Modern C++ Kafka API
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
KAFKA_API::KafkaMetrics Class Reference

Helps to parse the metrics string with JSON format. More...

#include <KafkaMetrics.h>

Public Types

using KeysType = std::vector< std::string >
 
template<typename ValueType >
using ResultsType = std::vector< std::pair< KeysType, ValueType > >
 The matched keys (for wildcards) and the value.
 

Public Member Functions

 KafkaMetrics (std::string jsonMetrics)
 Initilize with the metrics string.
 
ResultsType< std::int64_t > getInt (const KeysType &keys) const
 Get integer value(s) for the specified metrics. More...
 
ResultsType< std::string > getString (const KeysType &keys) const
 Get string value(s) for the specified metrics. More...
 

Static Public Member Functions

static std::string toString (const KafkaMetrics::KeysType &keys)
 
template<typename ValueType >
static std::string toString (const KafkaMetrics::ResultsType< ValueType > &results)
 

Static Public Attributes

static constexpr const char * WILDCARD = "*"
 

Detailed Description

Helps to parse the metrics string with JSON format.

Member Function Documentation

◆ getInt()

ResultsType<std::int64_t> KAFKA_API::KafkaMetrics::getInt ( const KeysType &  keys) const
inline

Get integer value(s) for the specified metrics.

Note: the wildcard ("*") is supported.

◆ getString()

ResultsType<std::string> KAFKA_API::KafkaMetrics::getString ( const KeysType &  keys) const
inline

Get string value(s) for the specified metrics.

Note: the wildcard ("*") is supported.


The documentation for this class was generated from the following file: