module Calamity.Metrics.Noop (runMetricsNoop) where
import Calamity.Metrics.Eff
import Calamity.Metrics.Internal
import Data.Default.Class
import Polysemy
runMetricsNoop :: Sem (MetricEff ': r) a -> Sem r a
runMetricsNoop :: forall (r :: [(* -> *) -> * -> *]) a.
Sem (MetricEff : r) a -> Sem r a
runMetricsNoop = (forall (rInitial :: [(* -> *) -> * -> *]) x.
MetricEff (Sem rInitial) x -> Sem r x)
-> Sem (MetricEff : r) a -> Sem r a
forall (e :: (* -> *) -> * -> *) (r :: [(* -> *) -> * -> *]) a.
FirstOrder e "interpret" =>
(forall (rInitial :: [(* -> *) -> * -> *]) x.
e (Sem rInitial) x -> Sem r x)
-> Sem (e : r) a -> Sem r a
interpret ((forall (rInitial :: [(* -> *) -> * -> *]) x.
MetricEff (Sem rInitial) x -> Sem r x)
-> Sem (MetricEff : r) a -> Sem r a)
-> (forall (rInitial :: [(* -> *) -> * -> *]) x.
MetricEff (Sem rInitial) x -> Sem r x)
-> Sem (MetricEff : r) a
-> Sem r a
forall a b. (a -> b) -> a -> b
$ \case
RegisterCounter Text
_ [(Text, Text)]
_ -> x -> Sem r x
forall a. a -> Sem r a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int -> Counter
Counter Int
0)
RegisterGauge Text
_ [(Text, Text)]
_ -> x -> Sem r x
forall a. a -> Sem r a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int -> Gauge
Gauge Int
0)
RegisterHistogram {} -> x -> Sem r x
forall a. a -> Sem r a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int -> Histogram
Histogram Int
0)
AddCounter Int
_ Counter
_ -> x -> Sem r x
forall a. a -> Sem r a
forall (f :: * -> *) a. Applicative f => a -> f a
pure x
forall a. Default a => a
def
ModifyGauge Double -> Double
_ Gauge
_ -> x -> Sem r x
forall a. a -> Sem r a
forall (f :: * -> *) a. Applicative f => a -> f a
pure x
forall a. Default a => a
def
ObserveHistogram Double
_ Histogram
_ -> x -> Sem r x
forall a. a -> Sem r a
forall (f :: * -> *) a. Applicative f => a -> f a
pure x
forall a. Default a => a
def