Fledge
An open source edge computing platform for industrial users
IngestRate Class Reference

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.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ IngestRate()

IngestRate::IngestRate ( ManagementClient mgmtClient,
const std::string &  service 
)

Constructor for ingest rate class.

Parameters
mgmtClientThe management Client interface

Member Function Documentation

◆ ingest()

void IngestRate::ingest ( unsigned int  numberReadings)

Called each time we ingest any readings.

Parameters
numberReadingsThe number of readings ingested

◆ periodic()

void IngestRate::periodic ( )

Called periodically by the stats update thread.

Called every FLUSH_STATS_INTERVAL seconds

◆ updateConfig()

void IngestRate::updateConfig ( int  interval,
int  factor 
)

Update the configuration of the ingest rate mechanism.

Parameters
intervalNumber of minutes to average over
factorNumber of standard deviations to tolarate

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