ANNA Suite
2020b
Multipurpose development suite for Telco applications
|
#include <Engine.hpp>
Public Member Functions | |
~Engine () | |
int | addConcept (const std::string &description, const std::string &unit, const bool &integerNatureSample=true) |
void | enable (void) |
void | disable (void) |
bool | enableSampleLog (const int &id=-1, const char *sampleFileName=NULL) |
bool | disableSampleLog (const int &id=-1) |
bool | getConcept (const int &id, std::string &description, std::string &unit, bool &integerNatureSample) const |
bool | enabled (void) const |
Accumulator * | createAccumulator (const std::string &name) noexcept(false) |
Accumulator * | getAccumulator (const std::string &name) |
std::string | asString (void) const |
anna::xml::Node * | asXML (anna::xml::Node *parent, const int &numberOfDecimals=2) const |
Friends | |
class | anna::Singleton< Engine > |
class | Accumulator |
Additional Inherited Members | |
![]() | |
static Engine & | instantiate () |
static void | release () |
Class used to configure general behaviour of statistics processing By default, the engine is disabled and enable must be invoked
anna::statistics::Engine::~Engine | ( | ) |
Destructor
int anna::statistics::Engine::addConcept | ( | const std::string & | description, |
const std::string & | unit, | ||
const bool & | integerNatureSample = true |
||
) |
Adds a new statistic concept (for example "Time_between_processA_and_processB", "Database time", etc)
description | Concept description |
unit | Concept unit description |
integerNatureSample | Most of cases we will measure 'time' with the unit which force integer values (is more intuitive 850 msecs than 0,850 secs). Then, it is true by default. This is useful to advice better representation for some indicators like minimum/maximum within integer samples. |
std::string anna::statistics::Engine::asString | ( | void | ) | const |
Class string representation
anna::xml::Node* anna::statistics::Engine::asXML | ( | anna::xml::Node * | parent, |
const int & | numberOfDecimals = 2 |
||
) | const |
Class XML representation
numberOfDecimals | Number of float decimals at XML representation. Default is 2. |
|
noexcept |
Creates a statistic accumulator
name | Accumulator name |
|
inline |
bool anna::statistics::Engine::disableSampleLog | ( | const int & | id = -1 | ) |
Disable sample log for statistics processings
id | Concept identification. If -1 value is provided, all concepts will be deactivated. |
|
inline |
|
inline |
bool anna::statistics::Engine::enableSampleLog | ( | const int & | id = -1 , |
const char * | sampleFileName = NULL |
||
) |
Enable sample log for statistics processings. Engine starts with this feature disabled. When a new concept id is added to the engine, sample log is also disabled for it.
Sample logs are used to dump each processing for a certain concept identification (<unix timestamp>="">,<processed value>="">).
id | Concept identification. If -1 value is provided, all concepts will be activated. |
sampleFileName | Absolute or relative to execution path, and completed with extension '.<concept id>="">.csv'. Empty string, disables log. Default file name is 'sample' |
Accumulator* anna::statistics::Engine::getAccumulator | ( | const std::string & | name | ) |
Returns accumulator instance identified by name.
name | Accumulator name |
bool anna::statistics::Engine::getConcept | ( | const int & | id, |
std::string & | description, | ||
std::string & | unit, | ||
bool & | integerNatureSample | ||
) | const |
Gets statistic concept information.
id | Concept identification. |
description | Concept description returned by reference |
unit | Concept unit description returned by reference |
integerNatureSample | nature returned by reference |
|
friend |
|
friend |