ddt 1.2.1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SamplesAccumulator Class Reference

#include <ddtMonitorSamplesDialog.hpp>

Public Member Functions

 SamplesAccumulator ()
 
void Reset ()
 
std::optional< float > UpdateSamples (unsigned int counter, std::chrono::system_clock::time_point ts)
 
std::pair< float, char const * > ReadableByteSize (std::optional< float > num_bytes)
 

Detailed Description

Auxiliar class that calculate teh average value from samples over time based on a time window. Based on a previous tool DDT Monitor.

Constructor & Destructor Documentation

◆ SamplesAccumulator()

SamplesAccumulator::SamplesAccumulator ( )
inline

Constructor

Member Function Documentation

◆ ReadableByteSize()

std::pair< float, char const * > SamplesAccumulator::ReadableByteSize ( std::optional< float > num_bytes)
inline

Method that updates the average of the samples value

Parameters
num_bytesNumber to be converted in bytes
Returns
res Pair of value and size dimension

◆ Reset()

void SamplesAccumulator::Reset ( )
inline

Method that clean private variables and start accumulating from the beginning

◆ UpdateSamples()

std::optional< float > SamplesAccumulator::UpdateSamples ( unsigned int counter,
std::chrono::system_clock::time_point ts )
inline

Method that updates the average of the samples value

Parameters
counterNumber of samples to analyse
tsPoint in time of the last received sample
Returns
res Value of the last average of samples

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