libstatistics_collector
master
Lightweight aggregation utilities to collect statistics and measure message metrics.
|
#include <collector.hpp>
Public Member Functions | |
Collector ()=default | |
virtual | ~Collector ()=default |
virtual void | AcceptData (const double measurement) |
virtual moving_average_statistics::StatisticData | GetStatisticsResults () const |
virtual void | ClearCurrentMeasurements () |
bool | IsStarted () const |
virtual std::string | GetStatusString () const |
virtual bool | Start () |
virtual bool | Stop () |
Public Member Functions inherited from libstatistics_collector::collector::MetricDetailsInterface | |
virtual | ~MetricDetailsInterface ()=default |
virtual std::string | GetMetricName () const =0 |
virtual std::string | GetMetricUnit () const =0 |
Simple class in order to collect observed data and generate statistics for the given observations.
|
default |
|
virtualdefault |
|
virtual |
Add an observed measurement. This aggregates the measurement and calculates statistics via the moving_average class.
the | measurement observed |
|
virtual |
Return the statistics for all of the observed data.
|
virtual |
Clear / reset all current measurements.
bool libstatistics_collector::collector::Collector::IsStarted | ( | ) | const |
Return true is start has been called, false otherwise.
|
virtual |
Return a pretty printed status representation of this class
|
virtual |
Start collecting data. Meant to be called after construction. Note: this locks the recursive mutex class member 'mutex'. This method is public in order for the caller to manually manage starting and stopping this collector.
|
virtual |
Stop collecting data. Meant to be a teardown method (before destruction, but should place the class in a restartable state, i.e., start can be called to be able to resume collection. This method is public in order for the caller to manually manage starting and stopping this collector.
This calls ClearCurrentMeasurements.