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 :: Type -> Type) (m :: Type -> Type) a | m -> b, a -> b where Source #

Get the current count for the given metric.

Methods

count :: a -> m Int Source #

retrieve a count

Instances

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

Defined in Data.Metrics.Counter

Methods

count :: Counter b -> m Int Source #

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

Defined in Data.Metrics.Histogram

Methods

count :: Histogram b -> m Int Source #

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

Defined in Data.Metrics.Meter

Methods

count :: Meter m -> m Int 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 #

class Rate (b :: Type -> Type) (m :: Type -> Type) 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.

Instances

Instances details
Rate IO IO (Meter IO) Source # 
Instance details

Defined in Data.Metrics.Meter

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

Defined in Data.Metrics.Timer

class Value (b :: Type -> Type) (m :: Type -> Type) a v | m -> b, a -> b v where Source #

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

Methods

value :: a -> m v Source #

Instances

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

Defined in Data.Metrics.Counter

Methods

value :: Counter b -> m Int Source #

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

Defined in Data.Metrics.Gauge

Methods

value :: Gauge b -> m Double Source #

class Set (b :: Type -> Type) (m :: Type -> Type) a v | m -> b, a -> b v where Source #

Update a metric by performing wholesale replacement of a value.

Methods

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

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

Instances

Instances details
(MonadBase b m, PrimMonad b) => Set b m (Counter b) Int Source # 
Instance details

Defined in Data.Metrics.Counter

Methods

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

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

Defined in Data.Metrics.Gauge

Methods

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

class Clear (b :: Type -> Type) (m :: Type -> Type) 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.

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

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

Defined in Data.Metrics.Counter

Methods

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

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

Defined in Data.Metrics.Histogram

Methods

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

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

Defined in Data.Metrics.Timer

Methods

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

class Statistics (b :: Type -> Type) (m :: Type -> Type) a | m -> b, a -> b where Source #

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

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.

Instances

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

Defined in Data.Metrics.Histogram

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

Defined in Data.Metrics.Timer

class Update (b :: Type -> Type) (m :: Type -> Type) a v | m -> b, a -> b v where Source #

Update statistics tracked by a metric with a new sample.

Methods

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

Feed a metric another value.

Instances

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

Defined in Data.Metrics.Histogram

Methods

update :: Histogram b -> Double -> m () 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 #

class TakeSnapshot (b :: Type -> Type) (m :: Type -> Type) a | m -> b, a -> b where Source #

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

Methods

snapshot :: a -> m Snapshot Source #

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

Instances

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

Defined in Data.Metrics.Histogram

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