PhoenixSwarm  3.5.0
Library to ease communication between daemons
Loading...
Searching...
No Matches
VecStat Class Reference

General statistics in the swarm. More...

#include <Representation.h>

Public Member Functions

std::vector< float > & getAverage ()
 Gets the average of the VecStat.
 
const std::vector< float > & getAverage () const
 Gets the average of the VecStat.
 
std::vector< time_t > & getEndTimestamp ()
 Gets the endTimestamp of the VecStat.
 
const std::vector< time_t > & getEndTimestamp () const
 Gets the endTimestamp of the VecStat.
 
std::vector< float > & getMax ()
 Gets the max of the VecStat.
 
const std::vector< float > & getMax () const
 Gets the max of the VecStat.
 
std::vector< float > & getMin ()
 Gets the min of the VecStat.
 
const std::vector< float > & getMin () const
 Gets the min of the VecStat.
 
std::vector< size_t > & getNbEvent ()
 Gets the nbEvent of the VecStat.
 
const std::vector< size_t > & getNbEvent () const
 Gets the nbEvent of the VecStat.
 
std::vector< float > & getRate ()
 Gets the rate of the VecStat.
 
const std::vector< float > & getRate () const
 Gets the rate of the VecStat.
 
std::vector< float > & getRateEventAboveUpperBound ()
 Gets the rateEventAboveUpperBound of the VecStat.
 
const std::vector< float > & getRateEventAboveUpperBound () const
 Gets the rateEventAboveUpperBound of the VecStat.
 
std::vector< float > & getRateEventBelowLowerBound ()
 Gets the rateEventBelowLowerBound of the VecStat.
 
const std::vector< float > & getRateEventBelowLowerBound () const
 Gets the rateEventBelowLowerBound of the VecStat.
 
std::vector< time_t > & getStartTimestamp ()
 Gets the startTimestamp of the VecStat.
 
const std::vector< time_t > & getStartTimestamp () const
 Gets the startTimestamp of the VecStat.
 
std::vector< std::vector< float > > & getVecRateQuantile ()
 Gets the vecRateQuantile of the VecStat.
 
const std::vector< std::vector< float > > & getVecRateQuantile () const
 Gets the vecRateQuantile of the VecStat.
 
VecStatoperator= (const VecStat &other)
 Operator = of class VecStat.
 
template<typename Stream, DataStreamMode::DataStreamMode Mode>
bool readWriteStream (Stream &ds)
 Load the current VecStat with a stream.
 
void setAverage (const std::vector< float > &average)
 Sets the average of the VecStat.
 
void setEndTimestamp (const std::vector< time_t > &endTimestamp)
 Sets the endTimestamp of the VecStat.
 
void setMax (const std::vector< float > &max)
 Sets the max of the VecStat.
 
void setMin (const std::vector< float > &min)
 Sets the min of the VecStat.
 
void setNbEvent (const std::vector< size_t > &nbEvent)
 Sets the nbEvent of the VecStat.
 
void setRate (const std::vector< float > &rate)
 Sets the rate of the VecStat.
 
void setRateEventAboveUpperBound (const std::vector< float > &rateEventAboveUpperBound)
 Sets the rateEventAboveUpperBound of the VecStat.
 
void setRateEventBelowLowerBound (const std::vector< float > &rateEventBelowLowerBound)
 Sets the rateEventBelowLowerBound of the VecStat.
 
void setStartTimestamp (const std::vector< time_t > &startTimestamp)
 Sets the startTimestamp of the VecStat.
 
void setVecRateQuantile (const std::vector< std::vector< float > > &vecRateQuantile)
 Sets the vecRateQuantile of the VecStat.
 
 VecStat ()
 Constructor of class VecStat.
 
 VecStat (const VecStat &other)
 Copy Constructor of class VecStat.
 
virtual ~VecStat ()
 Destructor of class VecStat.
 

Protected Member Functions

void copyVecStat (const VecStat &other)
 Copy Function of class VecStat.
 

Private Member Functions

void initialisationVecStat ()
 Initialisation Function of class VecStat.
 

Private Attributes

std::vector< float > p_average
 Mean of the stat.
 
std::vector< time_t > p_endTimestamp
 Timestamp where this stat was finished to be accumulated by the clock of the current daemon (TODO: need unit)
 
std::vector< float > p_max
 Maximum value of the stat.
 
std::vector< float > p_min
 Minimum value of the stat.
 
std::vector< size_t > p_nbEvent
 Number of events used to make this statistic.
 
std::vector< float > p_rate
 Number of events per second.
 
std::vector< float > p_rateEventAboveUpperBound
 Number of events above the upper boundary per second.
 
std::vector< float > p_rateEventBelowLowerBound
 Number of events below the lower boundary per second.
 
std::vector< time_t > p_startTimestamp
 Timestamp where this stat started to be accumulated by the clock of the current daemon (TODO: need unit)
 
std::vector< std::vector< float > > p_vecRateQuantile
 Vector of binned event rate per quantile (quartile decile, etc)
 

Detailed Description

General statistics in the swarm.

Definition at line 258 of file Representation.h.

Constructor & Destructor Documentation

◆ VecStat() [1/2]

VecStat::VecStat ( )

Constructor of class VecStat.

Definition at line 566 of file Representation.cpp.

566 {
568}
void initialisationVecStat()
Initialisation Function of class VecStat.

References initialisationVecStat().

Referenced by copyVecStat(), operator=(), and VecStat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~VecStat()

VecStat::~VecStat ( )
virtual

Destructor of class VecStat.

Definition at line 571 of file Representation.cpp.

571 {
572
573}

◆ VecStat() [2/2]

VecStat::VecStat ( const VecStat & other)

Copy Constructor of class VecStat.

Parameters
other: VecStat we want ot copy

Definition at line 578 of file Representation.cpp.

578 {
579 copyVecStat(other);
580}
void copyVecStat(const VecStat &other)
Copy Function of class VecStat.

References copyVecStat(), and VecStat().

+ Here is the call graph for this function:

Member Function Documentation

◆ copyVecStat()

void VecStat::copyVecStat ( const VecStat & other)
protected

Copy Function of class VecStat.

Parameters
other: VecStat we want ot copy

Definition at line 804 of file Representation.cpp.

804 {
805 p_nbEvent = other.p_nbEvent;
808 p_min = other.p_min;
809 p_max = other.p_max;
810 p_average = other.p_average;
811 p_rate = other.p_rate;
815}
std::vector< time_t > p_endTimestamp
Timestamp where this stat was finished to be accumulated by the clock of the current daemon (TODO: ne...
std::vector< float > p_max
Maximum value of the stat.
std::vector< float > p_rateEventAboveUpperBound
Number of events above the upper boundary per second.
std::vector< float > p_rateEventBelowLowerBound
Number of events below the lower boundary per second.
std::vector< float > p_min
Minimum value of the stat.
std::vector< float > p_average
Mean of the stat.
std::vector< time_t > p_startTimestamp
Timestamp where this stat started to be accumulated by the clock of the current daemon (TODO: need un...
std::vector< float > p_rate
Number of events per second.
std::vector< std::vector< float > > p_vecRateQuantile
Vector of binned event rate per quantile (quartile decile, etc)
std::vector< size_t > p_nbEvent
Number of events used to make this statistic.

References p_average, p_endTimestamp, p_max, p_min, p_nbEvent, p_rate, p_rateEventAboveUpperBound, p_rateEventBelowLowerBound, p_startTimestamp, p_vecRateQuantile, and VecStat().

Referenced by operator=(), and VecStat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAverage() [1/2]

std::vector< float > & VecStat::getAverage ( )

Gets the average of the VecStat.

Returns
average of the VecStat

Definition at line 741 of file Representation.cpp.

741 {
742 return p_average;
743}

References p_average.

◆ getAverage() [2/2]

const std::vector< float > & VecStat::getAverage ( ) const

Gets the average of the VecStat.

Returns
average of the VecStat

Definition at line 734 of file Representation.cpp.

734 {
735 return p_average;
736}

References p_average.

Referenced by CheckStream< VecStat >::check_stream(), and BaseDaemon::fillVecStat().

+ Here is the caller graph for this function:

◆ getEndTimestamp() [1/2]

std::vector< time_t > & VecStat::getEndTimestamp ( )

Gets the endTimestamp of the VecStat.

Returns
endTimestamp of the VecStat

Definition at line 699 of file Representation.cpp.

699 {
700 return p_endTimestamp;
701}

References p_endTimestamp.

◆ getEndTimestamp() [2/2]

const std::vector< time_t > & VecStat::getEndTimestamp ( ) const

Gets the endTimestamp of the VecStat.

Returns
endTimestamp of the VecStat

Definition at line 692 of file Representation.cpp.

692 {
693 return p_endTimestamp;
694}

References p_endTimestamp.

Referenced by CheckStream< VecStat >::check_stream(), and BaseDaemon::fillVecStat().

+ Here is the caller graph for this function:

◆ getMax() [1/2]

std::vector< float > & VecStat::getMax ( )

Gets the max of the VecStat.

Returns
max of the VecStat

Definition at line 727 of file Representation.cpp.

727 {
728 return p_max;
729}

References p_max.

◆ getMax() [2/2]

const std::vector< float > & VecStat::getMax ( ) const

Gets the max of the VecStat.

Returns
max of the VecStat

Definition at line 720 of file Representation.cpp.

720 {
721 return p_max;
722}

References p_max.

Referenced by CheckStream< VecStat >::check_stream(), and BaseDaemon::fillVecStat().

+ Here is the caller graph for this function:

◆ getMin() [1/2]

std::vector< float > & VecStat::getMin ( )

Gets the min of the VecStat.

Returns
min of the VecStat

Definition at line 713 of file Representation.cpp.

713 {
714 return p_min;
715}

References p_min.

◆ getMin() [2/2]

const std::vector< float > & VecStat::getMin ( ) const

Gets the min of the VecStat.

Returns
min of the VecStat

Definition at line 706 of file Representation.cpp.

706 {
707 return p_min;
708}

References p_min.

Referenced by CheckStream< VecStat >::check_stream(), and BaseDaemon::fillVecStat().

+ Here is the caller graph for this function:

◆ getNbEvent() [1/2]

std::vector< size_t > & VecStat::getNbEvent ( )

Gets the nbEvent of the VecStat.

Returns
nbEvent of the VecStat

Definition at line 671 of file Representation.cpp.

671 {
672 return p_nbEvent;
673}

References p_nbEvent.

◆ getNbEvent() [2/2]

const std::vector< size_t > & VecStat::getNbEvent ( ) const

Gets the nbEvent of the VecStat.

Returns
nbEvent of the VecStat

Definition at line 664 of file Representation.cpp.

664 {
665 return p_nbEvent;
666}

References p_nbEvent.

Referenced by CheckStream< VecStat >::check_stream(), and BaseDaemon::fillVecStat().

+ Here is the caller graph for this function:

◆ getRate() [1/2]

std::vector< float > & VecStat::getRate ( )

Gets the rate of the VecStat.

Returns
rate of the VecStat

Definition at line 755 of file Representation.cpp.

755 {
756 return p_rate;
757}

References p_rate.

◆ getRate() [2/2]

const std::vector< float > & VecStat::getRate ( ) const

Gets the rate of the VecStat.

Returns
rate of the VecStat

Definition at line 748 of file Representation.cpp.

748 {
749 return p_rate;
750}

References p_rate.

Referenced by CheckStream< VecStat >::check_stream(), and BaseDaemon::fillVecStat().

+ Here is the caller graph for this function:

◆ getRateEventAboveUpperBound() [1/2]

std::vector< float > & VecStat::getRateEventAboveUpperBound ( )

Gets the rateEventAboveUpperBound of the VecStat.

Returns
rateEventAboveUpperBound of the VecStat

Definition at line 797 of file Representation.cpp.

797 {
799}

References p_rateEventAboveUpperBound.

◆ getRateEventAboveUpperBound() [2/2]

const std::vector< float > & VecStat::getRateEventAboveUpperBound ( ) const

Gets the rateEventAboveUpperBound of the VecStat.

Returns
rateEventAboveUpperBound of the VecStat

Definition at line 790 of file Representation.cpp.

790 {
792}

References p_rateEventAboveUpperBound.

Referenced by CheckStream< VecStat >::check_stream(), and BaseDaemon::fillVecStat().

+ Here is the caller graph for this function:

◆ getRateEventBelowLowerBound() [1/2]

std::vector< float > & VecStat::getRateEventBelowLowerBound ( )

Gets the rateEventBelowLowerBound of the VecStat.

Returns
rateEventBelowLowerBound of the VecStat

Definition at line 783 of file Representation.cpp.

783 {
785}

References p_rateEventBelowLowerBound.

◆ getRateEventBelowLowerBound() [2/2]

const std::vector< float > & VecStat::getRateEventBelowLowerBound ( ) const

Gets the rateEventBelowLowerBound of the VecStat.

Returns
rateEventBelowLowerBound of the VecStat

Definition at line 776 of file Representation.cpp.

776 {
778}

References p_rateEventBelowLowerBound.

Referenced by CheckStream< VecStat >::check_stream(), and BaseDaemon::fillVecStat().

+ Here is the caller graph for this function:

◆ getStartTimestamp() [1/2]

std::vector< time_t > & VecStat::getStartTimestamp ( )

Gets the startTimestamp of the VecStat.

Returns
startTimestamp of the VecStat

Definition at line 685 of file Representation.cpp.

685 {
686 return p_startTimestamp;
687}

References p_startTimestamp.

◆ getStartTimestamp() [2/2]

const std::vector< time_t > & VecStat::getStartTimestamp ( ) const

Gets the startTimestamp of the VecStat.

Returns
startTimestamp of the VecStat

Definition at line 678 of file Representation.cpp.

678 {
679 return p_startTimestamp;
680}

References p_startTimestamp.

Referenced by CheckStream< VecStat >::check_stream(), and BaseDaemon::fillVecStat().

+ Here is the caller graph for this function:

◆ getVecRateQuantile() [1/2]

std::vector< std::vector< float > > & VecStat::getVecRateQuantile ( )

Gets the vecRateQuantile of the VecStat.

Returns
vecRateQuantile of the VecStat

Definition at line 769 of file Representation.cpp.

769 {
770 return p_vecRateQuantile;
771}

References p_vecRateQuantile.

◆ getVecRateQuantile() [2/2]

const std::vector< std::vector< float > > & VecStat::getVecRateQuantile ( ) const

Gets the vecRateQuantile of the VecStat.

Returns
vecRateQuantile of the VecStat

Definition at line 762 of file Representation.cpp.

762 {
763 return p_vecRateQuantile;
764}

References p_vecRateQuantile.

Referenced by CheckStream< VecStat >::check_stream(), and BaseDaemon::fillVecStat().

+ Here is the caller graph for this function:

◆ initialisationVecStat()

void VecStat::initialisationVecStat ( )
private

Initialisation Function of class VecStat.

Definition at line 818 of file Representation.cpp.

818 {
819}

Referenced by VecStat().

+ Here is the caller graph for this function:

◆ operator=()

VecStat & VecStat::operator= ( const VecStat & other)

Operator = of class VecStat.

Parameters
other: VecStat we want ot copy
Returns
copied class VecStat

Definition at line 586 of file Representation.cpp.

586 {
587 copyVecStat(other);
588 return *this;
589}

References copyVecStat(), and VecStat().

+ Here is the call graph for this function:

◆ readWriteStream()

template<typename Stream, DataStreamMode::DataStreamMode Mode>
bool VecStat::readWriteStream ( Stream & ds)
inline

Load the current VecStat with a stream.

Parameters
[out]ds: stream to be used
Returns
true on success, false otherwise

Definition at line 300 of file Representation.h.

300 {
301 bool b(true);
302 b &= DataStream<Stream, Mode, std::vector<size_t> >::data_stream(ds, p_nbEvent);
303 b &= DataStream<Stream, Mode, std::vector<time_t> >::data_stream(ds, p_startTimestamp);
304 b &= DataStream<Stream, Mode, std::vector<time_t> >::data_stream(ds, p_endTimestamp);
305 b &= DataStream<Stream, Mode, std::vector<float> >::data_stream(ds, p_min);
306 b &= DataStream<Stream, Mode, std::vector<float> >::data_stream(ds, p_max);
307 b &= DataStream<Stream, Mode, std::vector<float> >::data_stream(ds, p_average);
308 b &= DataStream<Stream, Mode, std::vector<float> >::data_stream(ds, p_rate);
309 b &= DataStream<Stream, Mode, std::vector<std::vector<float> > >::data_stream(ds, p_vecRateQuantile);
310 b &= DataStream<Stream, Mode, std::vector<float> >::data_stream(ds, p_rateEventBelowLowerBound);
311 b &= DataStream<Stream, Mode, std::vector<float> >::data_stream(ds, p_rateEventAboveUpperBound);
312 return b;
313 }

References p_average, p_endTimestamp, p_max, p_min, p_nbEvent, p_rate, p_rateEventAboveUpperBound, p_rateEventBelowLowerBound, p_startTimestamp, and p_vecRateQuantile.

Referenced by DataStream< Stream, Mode, VecStat >::data_stream().

+ Here is the caller graph for this function:

◆ setAverage()

void VecStat::setAverage ( const std::vector< float > & average)

Sets the average of the VecStat.

Parameters
average: average of the VecStat

Definition at line 629 of file Representation.cpp.

629 {
630 p_average = average;
631}

References p_average.

◆ setEndTimestamp()

void VecStat::setEndTimestamp ( const std::vector< time_t > & endTimestamp)

Sets the endTimestamp of the VecStat.

Parameters
endTimestamp: endTimestamp of the VecStat

Definition at line 608 of file Representation.cpp.

608 {
609 p_endTimestamp = endTimestamp;
610}

References p_endTimestamp.

◆ setMax()

void VecStat::setMax ( const std::vector< float > & max)

Sets the max of the VecStat.

Parameters
max: max of the VecStat

Definition at line 622 of file Representation.cpp.

622 {
623 p_max = max;
624}

References p_max.

◆ setMin()

void VecStat::setMin ( const std::vector< float > & min)

Sets the min of the VecStat.

Parameters
min: min of the VecStat

Definition at line 615 of file Representation.cpp.

615 {
616 p_min = min;
617}

References p_min.

◆ setNbEvent()

void VecStat::setNbEvent ( const std::vector< size_t > & nbEvent)

Sets the nbEvent of the VecStat.

Parameters
nbEvent: nbEvent of the VecStat

Definition at line 594 of file Representation.cpp.

594 {
595 p_nbEvent = nbEvent;
596}

References p_nbEvent.

◆ setRate()

void VecStat::setRate ( const std::vector< float > & rate)

Sets the rate of the VecStat.

Parameters
rate: rate of the VecStat

Definition at line 636 of file Representation.cpp.

636 {
637 p_rate = rate;
638}

References p_rate.

◆ setRateEventAboveUpperBound()

void VecStat::setRateEventAboveUpperBound ( const std::vector< float > & rateEventAboveUpperBound)

Sets the rateEventAboveUpperBound of the VecStat.

Parameters
rateEventAboveUpperBound: rateEventAboveUpperBound of the VecStat

Definition at line 657 of file Representation.cpp.

657 {
658 p_rateEventAboveUpperBound = rateEventAboveUpperBound;
659}

References p_rateEventAboveUpperBound.

◆ setRateEventBelowLowerBound()

void VecStat::setRateEventBelowLowerBound ( const std::vector< float > & rateEventBelowLowerBound)

Sets the rateEventBelowLowerBound of the VecStat.

Parameters
rateEventBelowLowerBound: rateEventBelowLowerBound of the VecStat

Definition at line 650 of file Representation.cpp.

650 {
651 p_rateEventBelowLowerBound = rateEventBelowLowerBound;
652}

References p_rateEventBelowLowerBound.

◆ setStartTimestamp()

void VecStat::setStartTimestamp ( const std::vector< time_t > & startTimestamp)

Sets the startTimestamp of the VecStat.

Parameters
startTimestamp: startTimestamp of the VecStat

Definition at line 601 of file Representation.cpp.

601 {
602 p_startTimestamp = startTimestamp;
603}

References p_startTimestamp.

◆ setVecRateQuantile()

void VecStat::setVecRateQuantile ( const std::vector< std::vector< float > > & vecRateQuantile)

Sets the vecRateQuantile of the VecStat.

Parameters
vecRateQuantile: vecRateQuantile of the VecStat

Definition at line 643 of file Representation.cpp.

643 {
644 p_vecRateQuantile = vecRateQuantile;
645}

References p_vecRateQuantile.

Member Data Documentation

◆ p_average

std::vector<float> VecStat::p_average
private

Mean of the stat.

Definition at line 330 of file Representation.h.

Referenced by copyVecStat(), getAverage(), getAverage(), readWriteStream(), and setAverage().

◆ p_endTimestamp

std::vector<time_t> VecStat::p_endTimestamp
private

Timestamp where this stat was finished to be accumulated by the clock of the current daemon (TODO: need unit)

Definition at line 324 of file Representation.h.

Referenced by copyVecStat(), getEndTimestamp(), getEndTimestamp(), readWriteStream(), and setEndTimestamp().

◆ p_max

std::vector<float> VecStat::p_max
private

Maximum value of the stat.

Definition at line 328 of file Representation.h.

Referenced by copyVecStat(), getMax(), getMax(), readWriteStream(), and setMax().

◆ p_min

std::vector<float> VecStat::p_min
private

Minimum value of the stat.

Definition at line 326 of file Representation.h.

Referenced by copyVecStat(), getMin(), getMin(), readWriteStream(), and setMin().

◆ p_nbEvent

std::vector<size_t> VecStat::p_nbEvent
private

Number of events used to make this statistic.

Definition at line 320 of file Representation.h.

Referenced by copyVecStat(), getNbEvent(), getNbEvent(), readWriteStream(), and setNbEvent().

◆ p_rate

std::vector<float> VecStat::p_rate
private

Number of events per second.

Definition at line 332 of file Representation.h.

Referenced by copyVecStat(), getRate(), getRate(), readWriteStream(), and setRate().

◆ p_rateEventAboveUpperBound

std::vector<float> VecStat::p_rateEventAboveUpperBound
private

Number of events above the upper boundary per second.

Definition at line 338 of file Representation.h.

Referenced by copyVecStat(), getRateEventAboveUpperBound(), getRateEventAboveUpperBound(), readWriteStream(), and setRateEventAboveUpperBound().

◆ p_rateEventBelowLowerBound

std::vector<float> VecStat::p_rateEventBelowLowerBound
private

Number of events below the lower boundary per second.

Definition at line 336 of file Representation.h.

Referenced by copyVecStat(), getRateEventBelowLowerBound(), getRateEventBelowLowerBound(), readWriteStream(), and setRateEventBelowLowerBound().

◆ p_startTimestamp

std::vector<time_t> VecStat::p_startTimestamp
private

Timestamp where this stat started to be accumulated by the clock of the current daemon (TODO: need unit)

Definition at line 322 of file Representation.h.

Referenced by copyVecStat(), getStartTimestamp(), getStartTimestamp(), readWriteStream(), and setStartTimestamp().

◆ p_vecRateQuantile

std::vector<std::vector<float> > VecStat::p_vecRateQuantile
private

Vector of binned event rate per quantile (quartile decile, etc)

Definition at line 334 of file Representation.h.

Referenced by copyVecStat(), getVecRateQuantile(), getVecRateQuantile(), readWriteStream(), and setVecRateQuantile().


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