metrics-0.4.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 #

A measure of time statistics for the duration of an event

Instances

(MonadBase b m, PrimMonad b) => TakeSnapshot b m (Timer b) # 

Methods

snapshot :: Timer b -> m Snapshot #

(MonadBase b m, PrimMonad b) => Statistics b m (Timer b) # 

Methods

maxVal :: Timer b -> m Double #

minVal :: Timer b -> m Double #

mean :: Timer b -> m Double #

stddev :: Timer b -> m Double #

variance :: Timer b -> m Double #

(MonadBase b m, PrimMonad b) => Clear b m (Timer b) # 

Methods

clear :: Timer b -> m () #

(MonadBase b m, PrimMonad b) => Rate b m (Timer b) # 
(MonadBase b m, PrimMonad b) => Count b m (Timer b) # 

Methods

count :: Timer b -> m Int #

(MonadBase b m, PrimMonad b) => Update b m (Timer b) Double # 

Methods

update :: Timer b -> Double -> m () #

Register (Timer IO) # 

Methods

register :: MetricRegistry IO -> Text -> IO (Timer IO) -> IO (Maybe (Timer IO)) #

mkTimer :: (MonadBase b m, PrimMonad b) => b NominalDiffTime -> Seed -> m (Timer b) #

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) #

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 #

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