MetroCollect  2.3.4
MetroCollect::MetricsSource::SourceBase Class Referenceabstract

Singleton abstract class, base class of all metric sources classes. More...

#include <Source.h>

Inheritance diagram for MetroCollect::MetricsSource::SourceBase:

Public Member Functions

 SourceBase (const SourceBase &)=delete
 Deleted copy constructor. More...
 
void operator= (const SourceBase &)=delete
 Deleted copy operator. More...
 
virtual size_t fieldCount () const noexcept=0
 Get the number of field the source has. More...
 
virtual const std::vector< size_t > indexesOfFieldName (const FieldName &fieldName, Interests *interests=nullptr) const noexcept=0
 Search for fields associated to a specific name. More...
 
virtual const std::string fieldNameSourcePrefix () const noexcept=0
 Get the prefix by which all field names should begin with. More...
 
virtual const FieldInfo fieldInfoAtIndex (size_t index) const noexcept=0
 Get details about a specific field. More...
 
virtual const std::vector< FieldInfoallFieldsInfo () const noexcept=0
 Get all fields details, field which share a common name should appear only once. More...
 
virtual void fetchData (const Interests &interests, DataArray::Iterator current)=0
 Fetch the latest metrics. More...
 
virtual void computeDiff (const Interests &interests, DiffArray::Iterator diff, DataArray::ConstIterator current, DataArray::ConstIterator previous, double factor=1) noexcept=0
 Compute the variation (in appropriate unit) of metrics. More...
 

Protected Member Functions

 SourceBase ()
 Protected default constructor. More...
 
 ~SourceBase ()
 Protected default destructor. More...
 

Detailed Description

Singleton abstract class, base class of all metric sources classes.

A subclass should override all methods of this class.

Definition at line 42 of file Source.h.

Constructor & Destructor Documentation

◆ SourceBase() [1/2]

MetroCollect::MetricsSource::SourceBase::SourceBase ( )
inlineprotected

Protected default constructor.

Definition at line 44 of file Source.h.

◆ ~SourceBase()

MetroCollect::MetricsSource::SourceBase::~SourceBase ( )
inlineprotected

Protected default destructor.

Definition at line 45 of file Source.h.

◆ SourceBase() [2/2]

MetroCollect::MetricsSource::SourceBase::SourceBase ( const SourceBase )
delete

Deleted copy constructor.

Member Function Documentation

◆ allFieldsInfo()

virtual const std::vector<FieldInfo> MetroCollect::MetricsSource::SourceBase::allFieldsInfo ( ) const
pure virtualnoexcept

Get all fields details, field which share a common name should appear only once.

Returns
all fields details

Implemented in MetroCollect::MetricsSource::SourceEthtool, MetroCollect::MetricsSource::SourceProcStat, MetroCollect::MetricsSource::SourceProcNetDev, and MetroCollect::MetricsSource::SourceProcMeminfo.

◆ computeDiff()

virtual void MetroCollect::MetricsSource::SourceBase::computeDiff ( const Interests interests,
DiffArray::Iterator  diff,
DataArray::ConstIterator  current,
DataArray::ConstIterator  previous,
double  factor = 1 
)
pure virtualnoexcept

Compute the variation (in appropriate unit) of metrics.

Parameters
interestsinterests boolean array to know for which fields metrics variation should be computed
diffiterator to write metrics variation to
currentiterator to read latest metrics from
previousiterator to read previous metrics from
factorfactor to convert to unit per second, if relevant

Implemented in MetroCollect::MetricsSource::SourceEthtool, MetroCollect::MetricsSource::SourceProcStat, MetroCollect::MetricsSource::SourceProcNetDev, and MetroCollect::MetricsSource::SourceProcMeminfo.

◆ fetchData()

virtual void MetroCollect::MetricsSource::SourceBase::fetchData ( const Interests interests,
DataArray::Iterator  current 
)
pure virtual

Fetch the latest metrics.

Parameters
interestsboolean array to know for which fields metrics should be fetched
currentiterator to write metrics to

Implemented in MetroCollect::MetricsSource::SourceEthtool, MetroCollect::MetricsSource::SourceProcStat, MetroCollect::MetricsSource::SourceProcNetDev, and MetroCollect::MetricsSource::SourceProcMeminfo.

◆ fieldCount()

virtual size_t MetroCollect::MetricsSource::SourceBase::fieldCount ( ) const
pure virtualnoexcept

◆ fieldInfoAtIndex()

virtual const FieldInfo MetroCollect::MetricsSource::SourceBase::fieldInfoAtIndex ( size_t  index) const
pure virtualnoexcept

Get details about a specific field.

Parameters
indexindex of the field to get details of
Returns
details of the field

Implemented in MetroCollect::MetricsSource::SourceEthtool, MetroCollect::MetricsSource::SourceProcStat, MetroCollect::MetricsSource::SourceProcNetDev, and MetroCollect::MetricsSource::SourceProcMeminfo.

◆ fieldNameSourcePrefix()

virtual const std::string MetroCollect::MetricsSource::SourceBase::fieldNameSourcePrefix ( ) const
pure virtualnoexcept

Get the prefix by which all field names should begin with.

Returns
the source's names prefix

Implemented in MetroCollect::MetricsSource::SourceEthtool, MetroCollect::MetricsSource::SourceProcStat, MetroCollect::MetricsSource::SourceProcNetDev, and MetroCollect::MetricsSource::SourceProcMeminfo.

◆ indexesOfFieldName()

virtual const std::vector<size_t> MetroCollect::MetricsSource::SourceBase::indexesOfFieldName ( const FieldName fieldName,
Interests interests = nullptr 
) const
pure virtualnoexcept

Search for fields associated to a specific name.

Parameters
fieldNamethe name of the fields to search
interestsif the pointer is not nullptr, the interest bit corresponding to the fields will be set
Returns
the indexes associated with the field name

Implemented in MetroCollect::MetricsSource::SourceEthtool, MetroCollect::MetricsSource::SourceProcStat, MetroCollect::MetricsSource::SourceProcNetDev, and MetroCollect::MetricsSource::SourceProcMeminfo.

◆ operator=()

void MetroCollect::MetricsSource::SourceBase::operator= ( const SourceBase )
delete

Deleted copy operator.


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