PhoenixSwarm  5.1.1
Library to ease communication between daemons
Loading...
Searching...
No Matches
Swarm::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 259 of file Representation.h.

Constructor & Destructor Documentation

◆ VecStat() [1/2]

VecStat::VecStat ( )

Constructor of class VecStat.

Definition at line 568 of file Representation.cpp.

568 {
570}
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 573 of file Representation.cpp.

573 {
574
575}

◆ VecStat() [2/2]

VecStat::VecStat ( const VecStat & other)

Copy Constructor of class VecStat.

Parameters
other: VecStat we want ot copy

Definition at line 580 of file Representation.cpp.

580 {
581 copyVecStat(other);
582}
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 806 of file Representation.cpp.

806 {
807 p_nbEvent = other.p_nbEvent;
810 p_min = other.p_min;
811 p_max = other.p_max;
812 p_average = other.p_average;
813 p_rate = other.p_rate;
817}
std::vector< float > p_min
Minimum value of the stat.
std::vector< float > p_average
Mean of the stat.
std::vector< float > p_rateEventAboveUpperBound
Number of events above the upper 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 un...
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_rateEventBelowLowerBound
Number of events below the lower boundary per second.
std::vector< std::vector< float > > p_vecRateQuantile
Vector of binned event rate per quantile (quartile decile, etc)
std::vector< float > p_max
Maximum 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.

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 743 of file Representation.cpp.

743 {
744 return p_average;
745}

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 736 of file Representation.cpp.

736 {
737 return p_average;
738}

References p_average.

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

+ 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 701 of file Representation.cpp.

701 {
702 return p_endTimestamp;
703}

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 694 of file Representation.cpp.

694 {
695 return p_endTimestamp;
696}

References p_endTimestamp.

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

+ 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 729 of file Representation.cpp.

729 {
730 return p_max;
731}

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 722 of file Representation.cpp.

722 {
723 return p_max;
724}

References p_max.

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

+ 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 715 of file Representation.cpp.

715 {
716 return p_min;
717}

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 708 of file Representation.cpp.

708 {
709 return p_min;
710}

References p_min.

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

+ 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 673 of file Representation.cpp.

673 {
674 return p_nbEvent;
675}

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 666 of file Representation.cpp.

666 {
667 return p_nbEvent;
668}

References p_nbEvent.

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

+ 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 757 of file Representation.cpp.

757 {
758 return p_rate;
759}

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 750 of file Representation.cpp.

750 {
751 return p_rate;
752}

References p_rate.

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

+ 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 799 of file Representation.cpp.

799 {
801}

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 792 of file Representation.cpp.

792 {
794}

References p_rateEventAboveUpperBound.

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

+ 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 785 of file Representation.cpp.

785 {
787}

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 778 of file Representation.cpp.

778 {
780}

References p_rateEventBelowLowerBound.

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

+ 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 687 of file Representation.cpp.

687 {
688 return p_startTimestamp;
689}

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 680 of file Representation.cpp.

680 {
681 return p_startTimestamp;
682}

References p_startTimestamp.

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

+ 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 771 of file Representation.cpp.

771 {
772 return p_vecRateQuantile;
773}

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 764 of file Representation.cpp.

764 {
765 return p_vecRateQuantile;
766}

References p_vecRateQuantile.

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

+ Here is the caller graph for this function:

◆ initialisationVecStat()

void VecStat::initialisationVecStat ( )
private

Initialisation Function of class VecStat.

Definition at line 820 of file Representation.cpp.

820 {
821}

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 588 of file Representation.cpp.

588 {
589 copyVecStat(other);
590 return *this;
591}

References copyVecStat(), and VecStat().

+ Here is the call graph for this function:

◆ readWriteStream()

template<typename Stream, DataStreamMode::DataStreamMode Mode>
bool Swarm::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 301 of file Representation.h.

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

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, Swarm::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 631 of file Representation.cpp.

631 {
632 p_average = average;
633}

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 610 of file Representation.cpp.

610 {
611 p_endTimestamp = endTimestamp;
612}

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 624 of file Representation.cpp.

624 {
625 p_max = max;
626}

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 617 of file Representation.cpp.

617 {
618 p_min = min;
619}

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 596 of file Representation.cpp.

596 {
597 p_nbEvent = nbEvent;
598}

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 638 of file Representation.cpp.

638 {
639 p_rate = rate;
640}

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 659 of file Representation.cpp.

659 {
660 p_rateEventAboveUpperBound = rateEventAboveUpperBound;
661}

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 652 of file Representation.cpp.

652 {
653 p_rateEventBelowLowerBound = rateEventBelowLowerBound;
654}

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 603 of file Representation.cpp.

603 {
604 p_startTimestamp = startTimestamp;
605}

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 645 of file Representation.cpp.

645 {
646 p_vecRateQuantile = vecRateQuantile;
647}

References p_vecRateQuantile.

Member Data Documentation

◆ p_average

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

Mean of the stat.

Definition at line 331 of file Representation.h.

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

◆ p_endTimestamp

std::vector<time_t> Swarm::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 325 of file Representation.h.

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

◆ p_max

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

Maximum value of the stat.

Definition at line 329 of file Representation.h.

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

◆ p_min

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

Minimum value of the stat.

Definition at line 327 of file Representation.h.

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

◆ p_nbEvent

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

Number of events used to make this statistic.

Definition at line 321 of file Representation.h.

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

◆ p_rate

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

Number of events per second.

Definition at line 333 of file Representation.h.

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

◆ p_rateEventAboveUpperBound

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

Number of events above the upper boundary per second.

Definition at line 339 of file Representation.h.

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

◆ p_rateEventBelowLowerBound

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

Number of events below the lower boundary per second.

Definition at line 337 of file Representation.h.

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

◆ p_startTimestamp

std::vector<time_t> Swarm::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 323 of file Representation.h.

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

◆ p_vecRateQuantile

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

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

Definition at line 335 of file Representation.h.

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


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