metrics-0.4.0.1: High-performance application metric tracking

Safe HaskellSafe
LanguageHaskell2010

Data.Metrics.MovingAverage

Description

A pure moving average module. The interface is agnostic to the scale of time that the average is tracking. It is up to the specific moving average module to handle that functionality.

Synopsis

Documentation

data MovingAverage Source #

This type encapsulates the interface of the different moving average implementations in such a way that they can be reused without plumbing the types through the other components that use moving averages. Most people won't ever need to use record fields of this type.

Constructors

MovingAverage 

Fields

clear :: MovingAverage -> MovingAverage Source #

Reset a moving average back to a starting state.

rate :: MovingAverage -> Double Source #

Get the current rate of the moving average.

tick :: MovingAverage -> MovingAverage Source #

Update the average based upon an interval specified by the moving average implementation.

update :: Double -> MovingAverage -> MovingAverage Source #

Update the average with the specified value.