instrument-0.6.1.0: Easy stats/metrics instrumentation for Haskell programs
CopyrightSoostone Inc
LicenseBSD3
MaintainerOzgun Ataman
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Instrument.ClientClass

Description

This module mimics the functionality of Instrument.Client but instead exposes a typeclass facilitated interface. Once you define the typeclass for your application's main monad, you can call all the mesaurement functions directly.

Synopsis

Documentation

data Instrument Source #

Instances

Instances details
Monad m => HasInstrument (ReaderT Instrument m) Source # 
Instance details

Defined in Instrument.ClientClass

initInstrument Source #

Arguments

:: ConnectInfo

Redis connection info

-> InstrumentConfig

Instrument configuration. Use "def" if you don't have specific needs

-> IO Instrument 

Initialize an instrument for measurement and feeding data into the system.

The resulting opaque Instrument is meant to be threaded around in your application to be later used in conjunction with sample and time.

class HasInstrument m where Source #

Instances

Instances details
Monad m => HasInstrument (ReaderT Instrument m) Source # 
Instance details

Defined in Instrument.ClientClass

sampleI :: (MonadIO m, HasInstrument m) => MetricName -> HostDimensionPolicy -> Dimensions -> Double -> m () Source #

Record a measurement sample

timeI :: (MonadIO m, HasInstrument m) => MetricName -> HostDimensionPolicy -> Dimensions -> m a -> m a Source #

Run a monadic action while measuring its runtime