Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Metrics.Timer
Description
A timer is basically a histogram of the duration of a type of event and a meter of the rate of its occurrence.
Documentation
data Timer (m :: Type -> Type) Source #
A measure of time statistics for the duration of an event
Instances
(MonadBase b m, PrimMonad b) => Clear b m (Timer b) Source # | |
Defined in Data.Metrics.Timer | |
(MonadBase b m, PrimMonad b) => Count b m (Timer b) Source # | |
(MonadBase b m, PrimMonad b) => Rate b m (Timer b) Source # | |
(MonadBase b m, PrimMonad b) => Statistics b m (Timer b) Source # | |
(MonadBase b m, PrimMonad b) => TakeSnapshot b m (Timer b) Source # | |
(MonadBase b m, PrimMonad b) => Update b m (Timer b) Double Source # | |
Register (Timer IO) Source # | |
mkTimer :: (MonadBase b m, PrimMonad b) => b NominalDiffTime -> Seed -> m (Timer b) Source #
Create a timer using a custom function for retrieving the current time.
This is mostly exposed for testing purposes: prefer using "timer" if possible.
timer :: MonadBase IO m => m (Timer IO) Source #
Create a standard Timer with an exponentially weighted moving average and an exponentially decaying histogram
time :: MonadBase IO m => Timer IO -> m a -> m a Source #
Execute an action and record statistics about the duration of the event and the rate of event occurrence.
module Data.Metrics.Types