Safe Haskell | None |
---|
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.
- data MetricRegistry m
- data Metric m
- = MetricGauge !(Gauge m)
- | MetricCounter !(Counter m)
- | MetricHistogram !(Histogram m)
- | MetricMeter !(Meter m)
- | MetricTimer !(Timer m)
- class Register a where
- metrics :: MetricRegistry m -> MVar (HashMap Text (Metric m))
- newMetricRegistry :: IO (MetricRegistry IO)
- module Data.Metrics.Types
Documentation
data MetricRegistry m 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
).
A sum type of all supported metric types that reporters should be able to output.
MetricGauge !(Gauge m) | |
MetricCounter !(Counter m) | |
MetricHistogram !(Histogram m) | |
MetricMeter !(Meter m) | |
MetricTimer !(Timer m) |
Add a new metric to a registry or retrieve the existing metric of the same name if one exists.
newMetricRegistry :: IO (MetricRegistry IO)Source
Initializes a new metric registry.
module Data.Metrics.Types