Safe Haskell | None |
---|
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.
- data Reservoir = forall s . Reservoir {
- _reservoirClear :: !(NominalDiffTime -> s -> s)
- _reservoirSize :: !(s -> Int)
- _reservoirSnapshot :: !(s -> Snapshot)
- _reservoirUpdate :: !(Double -> NominalDiffTime -> s -> s)
- _reservoirState :: !s
- clear :: NominalDiffTime -> Reservoir -> Reservoir
- size :: Reservoir -> Int
- snapshot :: Reservoir -> Snapshot
- update :: Double -> NominalDiffTime -> Reservoir -> Reservoir
Documentation
Encapsulates the internal state of a reservoir implementation.
The two standard implementations are the ExponentiallyDecayingReservoir and the UniformReservoir.
forall s . Reservoir | |
|
clear :: NominalDiffTime -> Reservoir -> ReservoirSource
Reset a reservoir to its initial state.