Contains statistical sample information.
More...
#include <Accumulator.hpp>
Contains statistical sample information.
Accumulated data information for statistic sample. It can manage a set of concepts at the same time.
◆ Accumulator()
anna::statistics::Accumulator::Accumulator |
( |
const std::string & |
name | ) |
|
|
inline |
◆ ~Accumulator()
anna::statistics::Accumulator::~Accumulator |
( |
| ) |
|
|
inline |
◆ addConcept()
int anna::statistics::Accumulator::addConcept |
( |
const std::string & |
description, |
|
|
const std::string & |
unit, |
|
|
const bool & |
integerNatureSample = true , |
|
|
const char * |
conceptNameFormat = "%s [%s]" |
|
) |
| |
Adds a new statistic concept through the accumulator, to ease the concept name creation, which will be a string defined by: concept name + ': ' + accumulator name.
- Parameters
-
description | Concept description; e.g.: processing time, messages size, etc. |
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. |
conceptNameFormat | Format to register the complete concept name. Will be parsed using (in order) the provided description, and the accumulator name: '<concept description>=""> [<accumulator name>="">]' by default. |
- Returns
- Assigned concept identification number (sequence)
◆ asString()
std::string anna::statistics::Accumulator::asString |
( |
const int & |
numberOfDecimals = 2 | ) |
const |
Class string representation
- Parameters
-
numberOfDecimals | Number of float decimals at representation string. Default is 2. |
- Returns
- String with class content
◆ asXML()
Class XML representation
- Parameters
-
numberOfDecimals | Number of float decimals at XML representation. Default is 2. |
- Returns
- XML with class content
◆ getName()
const std::string& anna::statistics::Accumulator::getName |
( |
void |
| ) |
const |
|
inline |
◆ getValue()
double anna::statistics::Accumulator::getValue |
( |
const int & |
conceptId, |
|
|
const Operation::Type & |
operation |
|
) |
| const |
|
noexcept |
Get statistical information
- Parameters
-
conceptId | Statistical concept |
operation | Solicited operation |
- Returns
- Value for solicited conceptId/operation
- See also
- sampleSize()
-
asXML()
◆ operator=()
Copy operator
- Parameters
-
accumulator | Class instance source of data |
- Returns
- Returns copied reference
◆ process()
void anna::statistics::Accumulator::process |
( |
const int & |
conceptId, |
|
|
const double & |
value |
|
) |
| |
|
noexcept |
Process new value for the sample regarding a concept identifier previously registered through the engine.
- Parameters
-
conceptId | statistical concept processed |
value | Value for processed item |
- See also
- reset()
◆ reset() [1/2]
void anna::statistics::Accumulator::reset |
( |
void |
| ) |
|
Reset sample for all concepts
- See also
- process()
◆ reset() [2/2]
void anna::statistics::Accumulator::reset |
( |
const int & |
conceptId | ) |
|
|
noexcept |
Reset sample for provided concept
- Parameters
-
conceptId | Concept identification to be reset |
- See also
- process()
◆ sampleSize()
unsigned long long int anna::statistics::Accumulator::sampleSize |
( |
const int & |
conceptId | ) |
const |
|
noexcept |
Gets current sample size for any concept id
- Parameters
-
conceptId | Concept identification |
- Returns
- Sample size
- See also
- getValue()
-
asXML()
◆ setName()
void anna::statistics::Accumulator::setName |
( |
const std::string & |
name | ) |
|
|
inline |
Sets the accumulator name
- Parameters
-
The documentation for this class was generated from the following file: