MetroCollect  2.3.4
MetroCollect::MetricsSource::MetricsSourceArray Struct Reference

Simple struct to hold references to each source singleton. More...

#include <MetricsSourceArray.h>

Collaboration diagram for MetroCollect::MetricsSource::MetricsSourceArray:

Public Member Functions

 MetricsSourceArray ()
 Construct a new Metrics Source Array object. More...
 
template<typename Function >
void forEach (Function func)
 Execute a function for each source. More...
 
template<typename Function >
void forEach (Function func) const
 Execute a const function for each source. More...
 

Public Attributes

SourceProcStatprocStat
 CPU metrics source (index: 1) More...
 
SourceProcMeminfoprocMemInfo
 Memory metrics source (index: 2) More...
 
SourceProcNetDevprocNetDev
 Network metrics source (index: 3) More...
 
SourceEthtoolethtool
 Ethtool metrics source (index: 4) More...
 

Static Public Attributes

static constexpr size_t count = 4
 Number of sources. More...
 

Detailed Description

Simple struct to hold references to each source singleton.

Definition at line 33 of file MetricsSourceArray.h.

Constructor & Destructor Documentation

◆ MetricsSourceArray()

MetroCollect::MetricsSource::MetricsSourceArray::MetricsSourceArray ( )

Construct a new Metrics Source Array object.

Definition at line 26 of file MetricsSourceArray.cc.

Member Function Documentation

◆ forEach() [1/2]

template<typename Function >
void MetroCollect::MetricsSource::MetricsSourceArray::forEach ( Function  func)
inline

Execute a function for each source.

Template Parameters
FunctionFunction type, which must accept two arguments: implicitly convertible to the source type and an integer
Parameters
funcfunction to execute

Definition at line 55 of file MetricsSourceArray.h.

Here is the caller graph for this function:

◆ forEach() [2/2]

template<typename Function >
void MetroCollect::MetricsSource::MetricsSourceArray::forEach ( Function  func) const
inline

Execute a const function for each source.

Template Parameters
FunctionConst function type, which must accept two arguments: implicitly convertible to the source type and an integer
Parameters
funcfunction to execute

Definition at line 69 of file MetricsSourceArray.h.

Member Data Documentation

◆ count

constexpr size_t MetroCollect::MetricsSource::MetricsSourceArray::count = 4
static

Number of sources.

Definition at line 39 of file MetricsSourceArray.h.

◆ ethtool

SourceEthtool& MetroCollect::MetricsSource::MetricsSourceArray::ethtool

Ethtool metrics source (index: 4)

Definition at line 37 of file MetricsSourceArray.h.

◆ procMemInfo

SourceProcMeminfo& MetroCollect::MetricsSource::MetricsSourceArray::procMemInfo

Memory metrics source (index: 2)

Definition at line 35 of file MetricsSourceArray.h.

◆ procNetDev

SourceProcNetDev& MetroCollect::MetricsSource::MetricsSourceArray::procNetDev

Network metrics source (index: 3)

Definition at line 36 of file MetricsSourceArray.h.

◆ procStat

SourceProcStat& MetroCollect::MetricsSource::MetricsSourceArray::procStat

CPU metrics source (index: 1)

Definition at line 34 of file MetricsSourceArray.h.


The documentation for this struct was generated from the following files: