metrics-0.4.0.1: High-performance application metric tracking

Safe HaskellNone
LanguageHaskell2010

Data.Metrics.Types

Description

The main accessors for common stateful metric implementation data.

Synopsis

Documentation

type Minutes = Int #

Histogram moving averages are tracked (by default) on minute scale.

class Count b m a | m -> b, a -> b where #

Get the current count for the given metric.

Minimal complete definition

count

Methods

count :: a -> m Int #

retrieve a count

Instances

(MonadBase b m, PrimMonad m) => Count b m (Meter m) # 

Methods

count :: Meter m -> m Int #

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

Methods

count :: Timer b -> m Int #

(MonadBase b m, PrimMonad b) => Count b m (Histogram b) # 

Methods

count :: Histogram b -> m Int #

(MonadBase b m, PrimMonad b) => Count b m (Counter b) # 

Methods

count :: Counter b -> m Int #

class Rate b m a | m -> b, a -> b where #

Provides statistics from a histogram that tracks the standard moving average rates.

Methods

oneMinuteRate :: a -> m Double #

Get the average rate of occurrence for some sort of event for the past minute.

fiveMinuteRate :: a -> m Double #

Get the average rate of occurrence for some sort of event for the past five minutes.

fifteenMinuteRate :: a -> m Double #

Get the average rate of occurrence for some sort of event for the past fifteen minutes.

meanRate :: a -> m Double #

Get the mean rate of occurrence for some sort of event for the entirety of the time that a has existed.

Instances

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

class Value b m a v | m -> b, a -> b v where #

Gets the current value from a simple metric (i.e. a Counter or a Gauge)

Minimal complete definition

value

Methods

value :: a -> m v #

Instances

(MonadBase b m, PrimMonad b) => Value b m (Gauge b) Double # 

Methods

value :: Gauge b -> m Double #

(MonadBase b m, PrimMonad b) => Value b m (Counter b) Int # 

Methods

value :: Counter b -> m Int #

class Set b m a v | m -> b, a -> b v where #

Update a metric by performing wholesale replacement of a value.

Minimal complete definition

set

Methods

set :: a -> v -> m () #

Replace the current value of a simple metric (i.e. a Counter or a Gauge)

Instances

(MonadBase b m, PrimMonad b) => Set b m (Counter b) Int # 

Methods

set :: Counter b -> Int -> m () #

(MonadBase b m, PrimMonad b) => Set b m (Gauge b) (b Double) # 

Methods

set :: Gauge b -> b Double -> m () #

class Clear b m a | m -> b, a -> b where #

Provides a way to reset metrics. This might be useful in a development environment or to periodically get a clean state for long-running processes.

Minimal complete definition

clear

Methods

clear :: a -> m () #

Reset the metric to an empty state. In practice, this should be equivalent to creating a new metric of the same type in-place.

Instances

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

Methods

clear :: Timer b -> m () #

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

Methods

clear :: Histogram b -> m () #

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

Methods

clear :: Counter b -> m () #

class Statistics b m a | m -> b, a -> b where #

Provides the main interface for retrieving statistics tabulated by a histogram.

Minimal complete definition

maxVal, minVal, mean, stddev, variance

Methods

maxVal :: a -> m Double #

Gets the highest value encountered thus far.

minVal :: a -> m Double #

Gets the lowest value encountered thus far.

mean :: a -> m Double #

Gets the current average value. This may have slightly different meanings depending on the type of MovingAverage used.

stddev :: a -> m Double #

Gets the standard deviation of all values encountered this var.

variance :: a -> m Double #

Gets the variance of all values encountered this var.

Instances

(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) => Statistics b m (Histogram b) # 

class Update b m a v | m -> b, a -> b v where #

Update statistics tracked by a metric with a new sample.

Minimal complete definition

update

Methods

update :: a -> v -> m () #

Feed a metric another value.

Instances

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

Methods

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

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

Methods

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

class TakeSnapshot b m a | m -> b, a -> b where #

Take a snapshot (a sorted vector) of samples used for calculating quantile data.

Minimal complete definition

snapshot

Methods

snapshot :: a -> m Snapshot #

Get a sample of the values currently in a histogram or type that contains a histogram.

Instances

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

Methods

snapshot :: Timer b -> m Snapshot #

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

Methods

snapshot :: Histogram b -> m Snapshot #