metrics-0.4.1.1: High-performance application metric tracking
Safe HaskellNone
LanguageHaskell2010

Data.Metrics.Registry

Description

An interface for bundling metrics in a way that they cna be iterated over for reporting or looked up for use by code that shares the registry.

Synopsis

Documentation

data MetricRegistry (m :: Type -> Type) Source #

A container that tracks all metrics registered with it. All forms of metrics share the same namespace in the registry. Consequently, attempting to replace a metric with one of a different type will fail (return Nothing from a call to register).

data Metric (m :: Type -> Type) Source #

A sum type of all supported metric types that reporters should be able to output.

class Register a where Source #

Add a new metric to a registry or retrieve the existing metric of the same name if one exists.

Methods

register :: MetricRegistry IO -> Text -> IO a -> IO (Maybe a) Source #

If possible, avoid using register to frequently retrieve metrics from a global registry. The metric registry is locked any time a lookup is performed, which may cause contention.

Instances

Instances details
Register (Counter IO) Source # 
Instance details

Defined in Data.Metrics.Registry

Register (Gauge IO) Source # 
Instance details

Defined in Data.Metrics.Registry

Register (Histogram IO) Source # 
Instance details

Defined in Data.Metrics.Registry

Register (Meter IO) Source # 
Instance details

Defined in Data.Metrics.Registry

Register (Timer IO) Source # 
Instance details

Defined in Data.Metrics.Registry

newMetricRegistry :: IO (MetricRegistry IO) Source #

Initializes a new metric registry.