Module

System.Metrics.Timer

Package
purescript-metrics
Repository
abhin4v/purescript-metrics

#Timer Source

newtype Timer

A timer is a histogram of the duration of a type of event and a meter of the rate of its occurrence.

#Summary Source

newtype Summary

Summary of the measurements in the meter. Contains:

  • duration: the summary of the underlying event duration histogram.
  • rate: the summary of the underlying event rate meter.

Constructors

Instances

#new Source

new :: forall eff. Eff (ref :: REF | eff) Timer

Creates a new timer.

#update Source

update :: forall eff a. Duration a => Timer -> a -> Eff (ref :: REF | eff) Unit

Updates the timer with the duration of a new event.

#time Source

time :: forall eff a. Timer -> Aff (now :: NOW, ref :: REF | eff) a -> Aff (now :: NOW, ref :: REF | eff) a

Runs and times the given function, updates the given timer with the run duration, and returns the return value of the function.

#fifteenMinuteRate Source

fifteenMinuteRate :: forall eff. Timer -> Eff (ref :: REF | eff) Number

Returns the fifteen minute moving average rate of the events recorded by the timer.

#fiveMinuteRate Source

fiveMinuteRate :: forall eff. Timer -> Eff (ref :: REF | eff) Number

Returns the five minute moving average rate of the events recorded by the timer.

#oneMinuteRate Source

oneMinuteRate :: forall eff. Timer -> Eff (ref :: REF | eff) Number

Returns the one minute moving average rate of the events recorded by the timer.

#meanRate Source

meanRate :: forall eff. Timer -> Eff (ref :: REF | eff) Number

Returns the mean rate of the events recorded by the timer.

#clear Source

clear :: forall eff. Timer -> Eff (ref :: REF | eff) Unit

Clears the timer.

#percentiles Source

percentiles :: forall eff. Timer -> Array Number -> Eff (ref :: REF | eff) (Maybe (Array Number))

Returns the percentiles of the measurements in the timer for the given percentiles array.

#mean Source

mean :: forall eff. Timer -> Eff (ref :: REF | eff) (Maybe Number)

Returns the mean of the measurements in the timer.

#stdDev Source

stdDev :: forall eff. Timer -> Eff (ref :: REF | eff) (Maybe Number)

Returns the standard deviation of the measurements in the timer.

#min Source

min :: forall eff. Timer -> Eff (ref :: REF | eff) (Maybe Number)

Returns the minimum of the measurements in the timer.

#max Source

max :: forall eff. Timer -> Eff (ref :: REF | eff) (Maybe Number)

Returns the maximum of the measurements in the timer.

#sum Source

sum :: forall eff. Timer -> Eff (ref :: REF | eff) (Maybe Number)

Returns the sum of the measurements in the timer.

#count Source

count :: forall eff. Timer -> Eff (ref :: REF | eff) Int

Returns the count of the measurements in the timer.

#read Source

read :: forall eff. Timer -> Eff (ref :: REF | eff) Summary

Returns the summary of the measurements in the timer.