metrics-0.4.1.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 :: Type -> Type) Source #

A measure of time statistics for the duration of an event

Instances

Instances details
(MonadBase b m, PrimMonad b) => Clear b m (Timer b) Source # 
Instance details

Defined in Data.Metrics.Timer

Methods

clear :: Timer b -> m () Source #

(MonadBase b m, PrimMonad b) => Count b m (Timer b) Source # 
Instance details

Defined in Data.Metrics.Timer

Methods

count :: Timer b -> m Int Source #

(MonadBase b m, PrimMonad b) => Rate b m (Timer b) Source # 
Instance details

Defined in Data.Metrics.Timer

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

Defined in Data.Metrics.Timer

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

Defined in Data.Metrics.Timer

Methods

snapshot :: Timer b -> m Snapshot Source #

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

Defined in Data.Metrics.Timer

Methods

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

Register (Timer IO) Source # 
Instance details

Defined in Data.Metrics.Registry

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.