metrics-0.2.1.0: High-performance application metric tracking

Safe HaskellNone

Data.Metrics.Types

Description

The main accessors for common stateful metric implementation data.

Synopsis

Documentation

type Minutes = IntSource

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

class Count m a | a -> m whereSource

Get the current count for the given metric.

Methods

count :: a -> m IntSource

retrieve a count

Instances

PrimMonad m => Count m (Timer m) 
PrimMonad m => Count m (Meter m) 
PrimMonad m => Count m (Histogram m) 
PrimMonad m => Count m (Counter m) 

class Rate m a | a -> m whereSource

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

Methods

oneMinuteRate :: a -> m DoubleSource

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

fiveMinuteRate :: a -> m DoubleSource

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

fifteenMinuteRate :: a -> m DoubleSource

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

meanRate :: a -> m DoubleSource

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

Instances

PrimMonad m => Rate m (Timer m) 
PrimMonad m => Rate m (Meter m) 

class Value m a v | a -> m v whereSource

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

Methods

value :: a -> m vSource

Instances

class Set m a v | a -> m v whereSource

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

PrimMonad m => Set m (Counter m) Int 
PrimMonad m => Set m (Gauge m) (m Double) 

class Clear m a | a -> m whereSource

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

PrimMonad m => Clear m (Timer m) 
PrimMonad m => Clear m (Histogram m) 
PrimMonad m => Clear m (Counter m) 

class Statistics m a | a -> m whereSource

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

Methods

maxVal :: a -> m DoubleSource

Gets the highest value encountered thus far.

minVal :: a -> m DoubleSource

Gets the lowest value encountered thus far.

mean :: a -> m DoubleSource

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

stddev :: a -> m DoubleSource

Gets the standard deviation of all values encountered this var.

variance :: a -> m DoubleSource

Gets the variance of all values encountered this var.

Instances

class Update m a v | a -> m v whereSource

Update statistics tracked by a metric with a new sample.

Methods

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

Feed a metric another value.

Instances

class TakeSnapshot m a | a -> m whereSource

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

Methods

snapshot :: a -> m SnapshotSource

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

Instances