metrics-0.4.0.1: High-performance application metric tracking

Safe HaskellNone
LanguageHaskell2010

Data.Metrics.Reservoir

Description

A reservoir is the internal storage mechanism for a Histogram. It provides a generic way to store histogram values in a way that allows us to avoid the need to plumb the implementation type through anything that uses a reservoir.

Synopsis

Documentation

data Reservoir Source #

Encapsulates the internal state of a reservoir implementation.

The two standard implementations are the ExponentiallyDecayingReservoir and the UniformReservoir.

Constructors

Reservoir 

Fields

clear :: NominalDiffTime -> Reservoir -> Reservoir Source #

Reset a reservoir to its initial state.

size :: Reservoir -> Int Source #

Get the current number of elements in the reservoir

snapshot :: Reservoir -> Snapshot Source #

Get a copy of all elements in the reservoir.

update :: Double -> NominalDiffTime -> Reservoir -> Reservoir Source #

Update a reservoir with a new value.

N.B. for some reservoir types, the latest value is not guaranteed to be retained in the reservoir.