System.Metrics
- Package
- purescript-metrics
- Repository
- abhin4v/purescript-metrics
#Value Source
data Value
Value of different metric samplers. Counter and Gauge values are their Int values. Histogram, Meter, and Timer values are the summary records of their values.
Constructors
Instances
#register Source
register :: forall eff. String -> MetricSampler -> Store -> Eff (ref :: REF | eff) Boolean
Registers a metric sampler with the given name, to the given metric store. Returns true if registration succeeds, false if registration fails because another metric sampler is already registered with the given name.
#registerOrGet Source
registerOrGet :: forall eff. String -> MetricSampler -> Store -> Eff (ref :: REF | eff) MetricSampler
Registers and returns a metric sampler with the given name, to the given metric store if another one is not registered with the given name. Else, returns the metric sampler registered with the given name.
#createOrGetCounter Source
createOrGetCounter :: forall eff. String -> Store -> Eff (exception :: EXCEPTION, ref :: REF | eff) Counter
Creates, registers and returns a Counter with the given name to the given store. If a Counter is already registered with the given name, returns it. Throws exception if a non-Counter metric sampler is already registered with the given name.
#createOrGetGauge Source
createOrGetGauge :: forall eff. String -> (forall e. Aff e Int) -> Store -> Eff (exception :: EXCEPTION, ref :: REF | eff) Gauge
Creates, registers and returns a Gauge with the given name to the given store. If a Gauge is already registered with the given name, returns it. Throws exception if a non-Gauge metric sampler is already registered with the given name.
#createOrGetHistogramWithExponentialDecaySampling Source
createOrGetHistogramWithExponentialDecaySampling :: forall eff. String -> Int -> Number -> Store -> Eff (exception :: EXCEPTION, ref :: REF | eff) Histogram
Creates, registers and returns a Histogram with exponential decay sampling, with the given name to the given store. If a Histogram is already registered with the given name, returns it. Throws exception if a non-Histogram metric sampler is already registered with the given name.
#createOrGetHistogramWithUniformSampling Source
createOrGetHistogramWithUniformSampling :: forall eff. String -> Int -> Store -> Eff (exception :: EXCEPTION, ref :: REF | eff) Histogram
Creates, registers and returns a Histogram with uniform sampling, with the given name to the given store. If a Histogram is already registered with the given name, returns it. Throws exception if a non-Histogram metric sampler is already registered with the given name.
#createOrGetMeter Source
createOrGetMeter :: forall eff. String -> Store -> Eff (exception :: EXCEPTION, ref :: REF | eff) Meter
Creates, registers and returns a Meter with the given name to the given store. If a Meter is already registered with the given name, returns it. Throws exception if a non-Meter metric sampler is already registered with the given name.
#createOrGetTimer Source
createOrGetTimer :: forall eff. String -> Store -> Eff (exception :: EXCEPTION, ref :: REF | eff) Timer
Creates, registers and returns a Timer with the given name to the given store. If a Timer is already registered with the given name, returns it. Throws exception if a non-Timer metric sampler is already registered with the given name.