metrics-0.3.0.1: High-performance application metric tracking

Safe HaskellNone
LanguageHaskell2010

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.

Synopsis

Documentation

data Timer m Source

A measure of time statistics for the duration of an event

Instances

PrimMonad m => TakeSnapshot m (Timer m) 
(Functor m, PrimMonad m) => Statistics m (Timer m) 
PrimMonad m => Clear m (Timer m) 
PrimMonad m => Rate m (Timer m) 
PrimMonad m => Count m (Timer m) 
PrimMonad m => Update m (Timer m) Double 
Register (Timer IO) 

mkTimer :: PrimMonad m => m NominalDiffTime -> Seed -> m (Timer m) 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 :: IO (Timer IO) Source

Create a standard Timer with an exponentially weighted moving average and an exponentially decaying histogram

time :: Timer IO -> IO a -> IO a Source

Execute an action and record statistics about the duration of the event and the rate of event occurrence.