preamble 0.0.31 → 0.0.32
raw patch · 2 files changed
+7/−7 lines, 2 files
Files
- preamble.cabal +1/−1
- src/Preamble/Stats.hs +6/−6
preamble.cabal view
@@ -1,5 +1,5 @@ name: preamble-version: 0.0.31+version: 0.0.32 synopsis: Yet another prelude. description: A prelude built on basic-prelude. homepage: https://github.com/swift-nav/preamble
src/Preamble/Stats.hs view
@@ -22,23 +22,23 @@ a <- view scSockAddr liftIO $ void $ sendTo s metric a -stats :: (MonadStatsCtx c m, Num a, Show a) => Text -> Text -> a -> Tags -> m ()+stats :: (MonadStatsCtx c m, Show a) => Text -> Text -> a -> Tags -> m () stats stat name value tags = do let metric = name -:- show value -|- stat tagged = intercalate "," $ flip map tags $ uncurry (-:-) sendto $ encodeUtf8 $ bool (metric -|- "#" <> tagged) metric $ null tags -statsCount :: (MonadStatsCtx c m, Num a, Show a) => Text -> a -> Tags -> m ()+statsCount :: (MonadStatsCtx c m, Show a) => Text -> a -> Tags -> m () statsCount = stats "c" -statsGauge :: (MonadStatsCtx c m, Num a, Show a) => Text -> a -> Tags -> m ()+statsGauge :: (MonadStatsCtx c m, Show a) => Text -> a -> Tags -> m () statsGauge = stats "g" -statsHistogram :: (MonadStatsCtx c m, Num a, Show a) => Text -> a -> Tags -> m ()+statsHistogram :: (MonadStatsCtx c m, Show a) => Text -> a -> Tags -> m () statsHistogram = stats "h" -statsTimer :: (MonadStatsCtx c m, Num a, Show a) => Text -> a -> Tags -> m ()+statsTimer :: (MonadStatsCtx c m, Show a) => Text -> a -> Tags -> m () statsTimer = stats "ms" -statsSet :: (MonadStatsCtx c m, Num a, Show a) => Text -> a -> Tags -> m ()+statsSet :: (MonadStatsCtx c m, Show a) => Text -> a -> Tags -> m () statsSet = stats "s"