calamity-0.1.13.0: A library for writing discord bots
Safe HaskellNone
LanguageHaskell2010

Calamity.Metrics.Eff

Description

Effect for handling metrics

Synopsis

Documentation

data Counter Source #

A handle to a counter

data Gauge Source #

A handle to a gauge

data Histogram Source #

A handle to a histogram

data HistogramSample Source #

Constructors

HistogramSample 

Fields

Instances

Instances details
Eq HistogramSample Source # 
Instance details

Defined in Calamity.Metrics.Eff

Show HistogramSample Source # 
Instance details

Defined in Calamity.Metrics.Eff

Generic HistogramSample Source # 
Instance details

Defined in Calamity.Metrics.Eff

Associated Types

type Rep HistogramSample :: Type -> Type #

TextShow HistogramSample Source # 
Instance details

Defined in Calamity.Metrics.Eff

Default HistogramSample Source # 
Instance details

Defined in Calamity.Metrics.Eff

type Rep HistogramSample Source # 
Instance details

Defined in Calamity.Metrics.Eff

type Rep HistogramSample = D1 ('MetaData "HistogramSample" "Calamity.Metrics.Eff" "calamity-0.1.13.0-inplace" 'False) (C1 ('MetaCons "HistogramSample" 'PrefixI 'True) (S1 ('MetaSel ('Just "buckets") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Double Double)) :*: (S1 ('MetaSel ('Just "sum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "count") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))

data MetricEff m a where Source #

Constructors

RegisterCounter

Register a Counter

Fields

RegisterGauge

Register a Gauge

Fields

RegisterHistogram

Register a Histogram

Fields

AddCounter :: Int -> Counter -> MetricEff m Int 
ModifyGauge :: (Double -> Double) -> Gauge -> MetricEff m Double 
ObserveHistogram :: Double -> Histogram -> MetricEff m HistogramSample 

Instances

Instances details
type DefiningModule (MetricEff :: k -> Type -> Type) Source # 
Instance details

Defined in Calamity.Metrics.Eff

type DefiningModule (MetricEff :: k -> Type -> Type) = "Calamity.Metrics.Eff"

registerCounter :: forall r. MemberWithError MetricEff r => Text -> [(Text, Text)] -> Sem r Counter Source #

registerGauge :: forall r. MemberWithError MetricEff r => Text -> [(Text, Text)] -> Sem r Gauge Source #

registerHistogram :: forall r. MemberWithError MetricEff r => Text -> [(Text, Text)] -> [Double] -> Sem r Histogram Source #

addCounter :: forall r. MemberWithError MetricEff r => Int -> Counter -> Sem r Int Source #

modifyGauge :: forall r. MemberWithError MetricEff r => (Double -> Double) -> Gauge -> Sem r Double Source #

observeHistogram :: forall r. MemberWithError MetricEff r => Double -> Histogram -> Sem r HistogramSample Source #