MetroCollect  2.3.4
MetroCollect::MetricsDiffArray Class Reference

Class to compute and store metric values variations. More...

#include <MetricsDiffArray.h>

Inheritance diagram for MetroCollect::MetricsDiffArray:
Collaboration diagram for MetroCollect::MetricsDiffArray:

Public Member Functions

 MetricsDiffArray () noexcept
 Construct a new Metrics Diff Array object. More...
 
 MetricsDiffArray (MetricsSource::SourceInterests sourceInterests) noexcept
 Construct a new Metrics Diff Array object. More...
 
const std::chrono::system_clock::time_point & startTime () const noexcept
 Get time of earlier metrics. More...
 
const std::chrono::system_clock::time_point & endTime () const noexcept
 Get time of latest metrics. More...
 
void computeDiff (MetricsArray< DataValueType > &current, MetricsArray< DataValueType > &previous, double factor) noexcept
 Compute and store the differences between two Metrics Data Arrays. More...
 
- Public Member Functions inherited from MetroCollect::MetricsArray< DiffValueType >
 MetricsArray () noexcept
 Construct a new Metrics Array object. More...
 
 MetricsArray (MetricsSource::SourceInterests sourceInterests) noexcept
 Construct a new Metrics Array object. More...
 
 MetricsArray (const MetricsArray &other) noexcept
 Copy constructor. More...
 
MetricsArrayoperator= (const MetricsArray &other) noexcept
 Assignment operator. More...
 
MetricsSource::SourceInterests sourceInterests () const noexcept
 Returns the source interests. More...
 
void setSourcesInterests (MetricsSource::SourceInterests sourceInterests) noexcept
 Set the source interests. More...
 
const std::chrono::system_clock::time_point & timestamp () const noexcept
 Returns the timestamp of stored metrics. More...
 
size_t fieldCount () const noexcept
 Returns the total number of available metrics. More...
 
const std::vector< size_t > indexesOfFieldName (const MetricsSource::FieldName &fieldName, bool setInterest=true) const noexcept
 Finds indexes of a field from its name across sources. More...
 
const MetricsSource::FieldInfo fieldInfoAtIndex (size_t index) const noexcept
 Get details about a specific metric field. More...
 
const std::vector< MetricsSource::FieldInfoallFieldsInfo () const noexcept
 Get details about all fields. More...
 
size_t size () const noexcept
 Returns the size of the underlying array. More...
 
DiffValueTypeat (size_t index)
 Access specified element. More...
 
const DiffValueTypeat (size_t index) const
 Access specified element. More...
 
DiffValueTypeoperator[] (size_t index)
 Access specified element. More...
 
const DiffValueTypeoperator[] (size_t index) const
 Access specified element. More...
 
std::pair< Iterator, IteratormetricsSliceForSource (size_t sourceIndex)
 Returns the iterator pair associated with a source. More...
 
Iterator begin () noexcept
 Returns an iterator to the first element of the container. More...
 
const ConstIterator begin () const noexcept
 Returns an iterator to the first element of the container. More...
 
Iterator end () noexcept
 Returns an iterator to the element following the last element of the container. More...
 
const ConstIterator end () const noexcept
 Returns an iterator to the element following the last element of the container. More...
 

Protected Attributes

std::chrono::system_clock::time_point startTime_
 Time of earlier metrics. More...
 
std::chrono::system_clock::time_point endTime_
 Time of latest metrics. More...
 
- Protected Attributes inherited from MetroCollect::MetricsArray< DiffValueType >
MetricsSource::SourceInterests sourceInterests_
 Boolean arrays to store source interests. More...
 
std::chrono::system_clock::time_point timestamp_
 Time at which metrics were collected. More...
 
std::vector< DiffValueTypedata_
 Underlying data storage. More...
 
MetricsSource::MetricsSourceArray sources_
 Array of sources to fetch data from. More...
 
std::array< std::pair< Iterator, Iterator >, MetricsSource::MetricsSourceArray::count > sourceIterators_
 Iterators pairs associating metrics to a source. More...
 
friend MetricsDiffArray
 To allow internal access by subclass. More...
 

Additional Inherited Members

- Public Types inherited from MetroCollect::MetricsArray< DiffValueType >
using ValueType = DiffValueType
 Type of stored metrics on the container. More...
 
using Iterator = typename std::vector< DiffValueType >::iterator
 Iterator type. More...
 
using ConstIterator = typename std::vector< DiffValueType >::const_iterator
 Const iterator type. More...
 
- Protected Member Functions inherited from MetroCollect::MetricsArray< DiffValueType >
void setSize () noexcept
 Resize the underlying container to fit the total number of metrics. More...
 
void setIterators () noexcept
 Update internal iterators pairs. More...
 

Detailed Description

Class to compute and store metric values variations.

Definition at line 30 of file MetricsDiffArray.h.

Constructor & Destructor Documentation

◆ MetricsDiffArray() [1/2]

MetroCollect::MetricsDiffArray::MetricsDiffArray ( )
noexcept

Construct a new Metrics Diff Array object.

Definition at line 25 of file MetricsDiffArray.cc.

◆ MetricsDiffArray() [2/2]

MetroCollect::MetricsDiffArray::MetricsDiffArray ( MetricsSource::SourceInterests  sourceInterests)
explicitnoexcept

Construct a new Metrics Diff Array object.

Parameters
sourceInterestsboolean arrays to store source interests

Definition at line 27 of file MetricsDiffArray.cc.

Member Function Documentation

◆ computeDiff()

void MetroCollect::MetricsDiffArray::computeDiff ( MetricsArray< DataValueType > &  current,
MetricsArray< DataValueType > &  previous,
double  factor 
)
noexcept

Compute and store the differences between two Metrics Data Arrays.

Parameters
currentlatest metric values
previousearlier metric values
factorfactor to convert metric differences to units per second

Definition at line 38 of file MetricsDiffArray.cc.

◆ endTime()

const std::chrono::system_clock::time_point & MetroCollect::MetricsDiffArray::endTime ( ) const
noexcept

Get time of latest metrics.

Returns
Time of latest metrics

Definition at line 34 of file MetricsDiffArray.cc.

Here is the caller graph for this function:

◆ startTime()

const std::chrono::system_clock::time_point & MetroCollect::MetricsDiffArray::startTime ( ) const
noexcept

Get time of earlier metrics.

Returns
Time of earlier metrics

Definition at line 30 of file MetricsDiffArray.cc.

Member Data Documentation

◆ endTime_

std::chrono::system_clock::time_point MetroCollect::MetricsDiffArray::endTime_
protected

Time of latest metrics.

Definition at line 33 of file MetricsDiffArray.h.

◆ startTime_

std::chrono::system_clock::time_point MetroCollect::MetricsDiffArray::startTime_
protected

Time of earlier metrics.

Definition at line 32 of file MetricsDiffArray.h.


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