PhoenixSwarm  5.1.1
Library to ease communication between daemons
Loading...
Searching...
No Matches
Swarm::Stat Class Reference

Statistics of a Daemon. More...

#include <Representation.h>

Public Member Functions

std::map< DaemonName, std::map< DataType, Swarm::VecStat > > & getMapStatCommunication ()
 Gets the mapStatCommunication of the Stat.
 
const std::map< DaemonName, std::map< DataType, Swarm::VecStat > > & getMapStatCommunication () const
 Gets the mapStatCommunication of the Stat.
 
std::map< PString, Swarm::VecStat > & getMapStatComputing ()
 Gets the mapStatComputing of the Stat.
 
const std::map< PString, Swarm::VecStat > & getMapStatComputing () const
 Gets the mapStatComputing of the Stat.
 
PString & getName ()
 Gets the name of the Stat.
 
const PString & getName () const
 Gets the name of the Stat.
 
Statoperator= (const Stat &other)
 Operator = of class Stat.
 
template<typename Stream, DataStreamMode::DataStreamMode Mode>
bool readWriteStream (Stream &ds)
 Load the current Stat with a stream.
 
void setMapStatCommunication (const std::map< DaemonName, std::map< DataType, Swarm::VecStat > > &mapStatCommunication)
 Sets the mapStatCommunication of the Stat.
 
void setMapStatComputing (const std::map< PString, Swarm::VecStat > &mapStatComputing)
 Sets the mapStatComputing of the Stat.
 
void setName (const PString &name)
 Sets the name of the Stat.
 
 Stat ()
 Constructor of class Stat.
 
 Stat (const Stat &other)
 Copy Constructor of class Stat.
 
virtual ~Stat ()
 Destructor of class Stat.
 

Protected Member Functions

void copyStat (const Stat &other)
 Copy Function of class Stat.
 

Private Member Functions

void initialisationStat ()
 Initialisation Function of class Stat.
 

Private Attributes

std::map< DaemonName, std::map< DataType, Swarm::VecStat > > p_mapStatCommunication
 Map of the communication statistics (key: destination daemon name, value: {key: data type, value: vector of associated stats }.
 
std::map< PString, Swarm::VecStatp_mapStatComputing
 Map of the computing statistics (key: stat name, value vector of stat)
 
PString p_name
 Name of the Daemon where the stats come from.
 

Detailed Description

Statistics of a Daemon.

Definition at line 368 of file Representation.h.

Constructor & Destructor Documentation

◆ Stat() [1/2]

Stat::Stat ( )

Constructor of class Stat.

Definition at line 848 of file Representation.cpp.

848 {
850}
void initialisationStat()
Initialisation Function of class Stat.

References initialisationStat().

Referenced by copyStat(), operator=(), and Stat().

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

◆ ~Stat()

Stat::~Stat ( )
virtual

Destructor of class Stat.

Definition at line 853 of file Representation.cpp.

853 {
854
855}

◆ Stat() [2/2]

Stat::Stat ( const Stat & other)

Copy Constructor of class Stat.

Parameters
other: Stat we want ot copy

Definition at line 860 of file Representation.cpp.

860 {
861 copyStat(other);
862}
void copyStat(const Stat &other)
Copy Function of class Stat.

References copyStat(), and Stat().

+ Here is the call graph for this function:

Member Function Documentation

◆ copyStat()

void Stat::copyStat ( const Stat & other)
protected

Copy Function of class Stat.

Parameters
other: Stat we want ot copy

Definition at line 939 of file Representation.cpp.

939 {
940 p_name = other.p_name;
943}
std::map< DaemonName, std::map< DataType, Swarm::VecStat > > p_mapStatCommunication
Map of the communication statistics (key: destination daemon name, value: {key: data type,...
std::map< PString, Swarm::VecStat > p_mapStatComputing
Map of the computing statistics (key: stat name, value vector of stat)
PString p_name
Name of the Daemon where the stats come from.

References p_mapStatCommunication, p_mapStatComputing, p_name, and Stat().

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

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

◆ getMapStatCommunication() [1/2]

std::map< DaemonName, std::map< DataType, Swarm::VecStat > > & Stat::getMapStatCommunication ( )

Gets the mapStatCommunication of the Stat.

Returns
mapStatCommunication of the Stat

Definition at line 932 of file Representation.cpp.

932 {
934}

References p_mapStatCommunication.

◆ getMapStatCommunication() [2/2]

const std::map< DaemonName, std::map< DataType, Swarm::VecStat > > & Stat::getMapStatCommunication ( ) const

Gets the mapStatCommunication of the Stat.

Returns
mapStatCommunication of the Stat

Definition at line 925 of file Representation.cpp.

925 {
927}

References p_mapStatCommunication.

Referenced by CheckStream< Swarm::Stat >::check_stream(), Swarm::BaseDaemon::fillDaemonStat(), and testFillDaemonStat().

+ Here is the caller graph for this function:

◆ getMapStatComputing() [1/2]

std::map< PString, Swarm::VecStat > & Stat::getMapStatComputing ( )

Gets the mapStatComputing of the Stat.

Returns
mapStatComputing of the Stat

Definition at line 918 of file Representation.cpp.

918 {
919 return p_mapStatComputing;
920}

References p_mapStatComputing.

◆ getMapStatComputing() [2/2]

const std::map< PString, Swarm::VecStat > & Stat::getMapStatComputing ( ) const

Gets the mapStatComputing of the Stat.

Returns
mapStatComputing of the Stat

Definition at line 911 of file Representation.cpp.

911 {
912 return p_mapStatComputing;
913}

References p_mapStatComputing.

Referenced by CheckStream< Swarm::Stat >::check_stream(), Swarm::BaseDaemon::fillDaemonStat(), and testFillDaemonStat().

+ Here is the caller graph for this function:

◆ getName() [1/2]

PString & Stat::getName ( )

Gets the name of the Stat.

Returns
name of the Stat

Definition at line 904 of file Representation.cpp.

904 {
905 return p_name;
906}

References p_name.

◆ getName() [2/2]

const PString & Stat::getName ( ) const

Gets the name of the Stat.

Returns
name of the Stat

Definition at line 897 of file Representation.cpp.

897 {
898 return p_name;
899}

References p_name.

Referenced by CheckStream< Swarm::Stat >::check_stream(), and Swarm::Monitoring< _TBackend >::fillStatInfo().

+ Here is the caller graph for this function:

◆ initialisationStat()

void Stat::initialisationStat ( )
private

Initialisation Function of class Stat.

Definition at line 946 of file Representation.cpp.

946 {
947 p_name = "";
948}

References p_name.

Referenced by Stat().

+ Here is the caller graph for this function:

◆ operator=()

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

Operator = of class Stat.

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

Definition at line 868 of file Representation.cpp.

868 {
869 copyStat(other);
870 return *this;
871}

References copyStat(), and Stat().

+ Here is the call graph for this function:

◆ readWriteStream()

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

Load the current Stat with a stream.

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

Definition at line 389 of file Representation.h.

389 {
390 bool b(true);
391 b &= DataStream<Stream, Mode, PString >::data_stream(ds, p_name);
392 b &= DataStream<Stream, Mode, std::map<PString, Swarm::VecStat > >::data_stream(ds, p_mapStatComputing);
393 b &= DataStream<Stream, Mode, std::map<DaemonName, std::map<DataType, Swarm::VecStat > > >::data_stream(ds, p_mapStatCommunication);
394 return b;
395 }

References p_mapStatCommunication, p_mapStatComputing, and p_name.

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

+ Here is the caller graph for this function:

◆ setMapStatCommunication()

void Stat::setMapStatCommunication ( const std::map< DaemonName, std::map< DataType, Swarm::VecStat > > & mapStatCommunication)

Sets the mapStatCommunication of the Stat.

Parameters
mapStatCommunication: mapStatCommunication of the Stat

Definition at line 890 of file Representation.cpp.

890 {
891 p_mapStatCommunication = mapStatCommunication;
892}

References p_mapStatCommunication.

◆ setMapStatComputing()

void Stat::setMapStatComputing ( const std::map< PString, Swarm::VecStat > & mapStatComputing)

Sets the mapStatComputing of the Stat.

Parameters
mapStatComputing: mapStatComputing of the Stat

Definition at line 883 of file Representation.cpp.

883 {
884 p_mapStatComputing = mapStatComputing;
885}

References p_mapStatComputing.

◆ setName()

void Stat::setName ( const PString & name)

Sets the name of the Stat.

Parameters
name: name of the Stat

Definition at line 876 of file Representation.cpp.

876 {
877 p_name = name;
878}

References p_name.

Referenced by Swarm::Daemon< _TBackend >::sendStatToStatDaemon().

+ Here is the caller graph for this function:

Member Data Documentation

◆ p_mapStatCommunication

std::map<DaemonName, std::map<DataType, Swarm::VecStat > > Swarm::Stat::p_mapStatCommunication
private

Map of the communication statistics (key: destination daemon name, value: {key: data type, value: vector of associated stats }.

Definition at line 406 of file Representation.h.

Referenced by copyStat(), getMapStatCommunication(), getMapStatCommunication(), readWriteStream(), and setMapStatCommunication().

◆ p_mapStatComputing

std::map<PString, Swarm::VecStat > Swarm::Stat::p_mapStatComputing
private

Map of the computing statistics (key: stat name, value vector of stat)

Definition at line 404 of file Representation.h.

Referenced by copyStat(), getMapStatComputing(), getMapStatComputing(), readWriteStream(), and setMapStatComputing().

◆ p_name

PString Swarm::Stat::p_name
private

Name of the Daemon where the stats come from.

Definition at line 402 of file Representation.h.

Referenced by copyStat(), getName(), getName(), initialisationStat(), readWriteStream(), and setName().


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