![]() |
Fledge
An open source edge computing platform for industrial users
|
A class used to track and report on the ingest rates of a data stream. More...
#include <ingest_rate.h>
Public Member Functions | |
IngestRate (ManagementClient *mgmtClient, const std::string &service) | |
Constructor for ingest rate class. More... | |
~IngestRate () | |
Destructor for the ingest rate class. | |
void | ingest (unsigned int numberReadings) |
Called each time we ingest any readings. More... | |
void | periodic () |
Called periodically by the stats update thread. More... | |
void | updateConfig (int interval, int factor) |
Update the configuration of the ingest rate mechanism. More... | |
void | relearn () |
The configuration has changed so we need to reset our state and go back into the mode of determining what a good mean and standard deviation is for the select interval. | |
A class used to track and report on the ingest rates of a data stream.
It collects the number of readings ingested in a configurable period, the period being defined in minutes. It then calculates the mean of the collection rates and the standard deviation. If the current collection rate differs from the averaged collection rate by more than a configured number of standard deviations an alert is raised. A "priming" mechanism is used to require two consecutive deviations from the norm to be required before an alert is trigger. This reduces the occurance of false positives caused by transient spikes in colection. These spikes may occur when heavy operations are performed on the Fledge instance.
When the rate returns to within the number of defined standard deviations of the average then the alert is cleared.
Before alerting is enabled a number of the defined time periods, IGRSAMPLES, must have passed, during this time an average is calculated and used for the intial comparision.
If the user reconfigures the collection rate of the plugin then the accumulated average is discarded and the process starts again by collecting a new average
IngestRate::IngestRate | ( | ManagementClient * | mgmtClient, |
const std::string & | service | ||
) |
Constructor for ingest rate class.
mgmtClient | The management Client interface |
void IngestRate::ingest | ( | unsigned int | numberReadings | ) |
Called each time we ingest any readings.
numberReadings | The number of readings ingested |
void IngestRate::periodic | ( | ) |
Called periodically by the stats update thread.
Called every FLUSH_STATS_INTERVAL seconds
void IngestRate::updateConfig | ( | int | interval, |
int | factor | ||
) |
Update the configuration of the ingest rate mechanism.
interval | Number of minutes to average over |
factor | Number of standard deviations to tolarate |