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

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

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

Get the current count for the given metric.

Minimal complete definition

count

Methods

count :: a -> m Int Source #

retrieve a count

Instances

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

Methods

count :: Meter m -> m Int Source #

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

Methods

count :: Timer b -> m Int Source #

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

Methods

count :: Histogram b -> m Int Source #

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

Methods

count :: Counter b -> m Int Source #

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

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

Methods

oneMinuteRate :: a -> m Double Source #

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

fiveMinuteRate :: a -> m Double Source #

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

fifteenMinuteRate :: a -> m Double Source #

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

meanRate :: a -> m Double Source #

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

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

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

Minimal complete definition

value

Methods

value :: a -> m v Source #

Instances

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

Methods

value :: Gauge b -> m Double Source #

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

Methods

value :: Counter b -> m Int Source #

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

Update a metric by performing wholesale replacement of a value.

Minimal complete definition

set

Methods

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

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

Methods

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

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

Methods

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

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

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

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

Methods

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

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

Methods

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

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

Methods

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

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

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

Minimal complete definition

maxVal, minVal, mean, stddev, variance

Methods

maxVal :: a -> m Double Source #

Gets the highest value encountered thus far.

minVal :: a -> m Double Source #

Gets the lowest value encountered thus far.

mean :: a -> m Double Source #

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

stddev :: a -> m Double Source #

Gets the standard deviation of all values encountered this var.

variance :: a -> m Double Source #

Gets the variance of all values encountered this var.

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

Update statistics tracked by a metric with a new sample.

Minimal complete definition

update

Methods

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

Feed a metric another value.

Instances

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

Methods

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

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

Methods

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

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

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

Minimal complete definition

snapshot

Methods

snapshot :: a -> m Snapshot Source #

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

Instances