datalogd.plugins.aggregator_datafilter module¶
- class datalogd.plugins.aggregator_datafilter.AggregatorDataFilter(sinks=[], buffer_size=100, send_every=100, aggregate=['timestamp', 'value'])[source]¶
Bases:
DataFilterAggregates consecutively received data values into a list and passes the new array(s) on to sinks.
The aggregated data can be sent at different intervals to that which it is received by using the
send_everyparameter. A value of 1 will send the aggregated data every time new data is received. A value ofsend_everyequal tobuffer_sizewill result in the data being passed on only once the buffer is filled. A typical usage example would be for data which is received once every second, usingbuffer_size=86400andsend_every=60to store up to 24 hours of data, and update sinks every minute.- Parameters:
buffer_size – Maximum length for lists of aggregated data.
send_every – Send data to connected sinks every n updates.
aggregate – List of data keys for which the values should be aggregated.