NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
NES::Monitoring::Metric Class Reference

The metric class is a conceptual superclass that represents all metrics in NES. Currently existing metrics are Counter, GaugeCollectors, Histogram and Meter. More...

#include <Metric.hpp>

Public Member Functions

template<typename T >
 Metric (T x)
 The ctor of the metric, which takes an arbitrary value. More...
 
template<typename T >
 Metric (T x, MetricType type)
 
 ~Metric ()=default
 
 Metric (const Metric &x)
 copy ctor to properly handle the templated values More...
 
 Metric (Metric &&) noexcept=default
 
Metricoperator= (const Metric &x)
 assign operator for metrics to avoid unnecessary copies More...
 
Metricoperator= (Metric &&x) noexcept=default
 
template<typename T >
T & getValue () const
 This method returns the originally stored metric value, e.g. int, string, GaugeCollectors. More...
 
MetricType getMetricType () const
 This method returns the type of the stored metric. Note that the according function needs to be defined, otherwise it will be categorized as UnknownType. More...
 

Friends

nlohmann::json asJson (const Metric &metric)
 This method returns the value of the metric as a JSON. More...
 
void writeToBuffer (const Metric &x, Runtime::TupleBuffer &buf, uint64_t tupleIndex)
 This method returns the type of the stored metric. Note that the according function needs to be defined, otherwise it will be categorized as UnknownType. More...
 
void readFromBuffer (const Metric &x, Runtime::TupleBuffer &buf, uint64_t tupleIndex)
 This method returns the type of the stored metric. Note that the according function needs to be defined, otherwise it will be categorized as UnknownType. More...
 

Detailed Description

The metric class is a conceptual superclass that represents all metrics in NES. Currently existing metrics are Counter, GaugeCollectors, Histogram and Meter.

Constructor & Destructor Documentation

◆ Metric() [1/4]

template<typename T >
NES::Monitoring::Metric::Metric ( x)
inlineexplicit

The ctor of the metric, which takes an arbitrary value.

Parameters
arbitraryparameter of any type @dev too broad to make non-explicit.

References NES::Monitoring::UnknownMetric.

Referenced by operator=().

Here is the caller graph for this function:

◆ Metric() [2/4]

template<typename T >
NES::Monitoring::Metric::Metric ( x,
MetricType  type 
)
inlineexplicit

◆ ~Metric()

NES::Monitoring::Metric::~Metric ( )
default

◆ Metric() [3/4]

NES::Monitoring::Metric::Metric ( const Metric x)
inline

copy ctor to properly handle the templated values

Parameters
themetric

◆ Metric() [4/4]

NES::Monitoring::Metric::Metric ( Metric &&  )
defaultnoexcept

Member Function Documentation

◆ getMetricType()

MetricType NES::Monitoring::Metric::getMetricType ( ) const
inline

This method returns the type of the stored metric. Note that the according function needs to be defined, otherwise it will be categorized as UnknownType.

Parameters
themetric
Returns
the type of the metric

◆ getValue()

template<typename T >
T& NES::Monitoring::Metric::getValue ( ) const
inline

This method returns the originally stored metric value, e.g. int, string, GaugeCollectors.

Template Parameters
thetype of the value
Returns
the value

References data.

◆ operator=() [1/2]

Metric& NES::Monitoring::Metric::operator= ( const Metric x)
inline

assign operator for metrics to avoid unnecessary copies

References Metric().

Here is the call graph for this function:

◆ operator=() [2/2]

Metric& NES::Monitoring::Metric::operator= ( Metric &&  x)
defaultnoexcept

Friends And Related Function Documentation

◆ asJson

nlohmann::json asJson ( const Metric metric)
friend

This method returns the value of the metric as a JSON.

Parameters
metric
Returns
The metric represented as JSON.

◆ readFromBuffer

void readFromBuffer ( const Metric x,
Runtime::TupleBuffer buf,
uint64_t  tupleIndex 
)
friend

This method returns the type of the stored metric. Note that the according function needs to be defined, otherwise it will be categorized as UnknownType.

Parameters
themetric
Returns
the type of the metric

◆ writeToBuffer

void writeToBuffer ( const Metric x,
Runtime::TupleBuffer buf,
uint64_t  tupleIndex 
)
friend

This method returns the type of the stored metric. Note that the according function needs to be defined, otherwise it will be categorized as UnknownType.

Parameters
themetric
Returns
the type of the metric

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