statsdi-0.1.0.0: src/Control/Monad/Stats.hs
module Control.Monad.Stats
( module Export
) where
import Control.Monad.Stats.MTL as Export
import Control.Monad.Stats.TH as Export
import Control.Monad.Stats.Types as Export
-- sample usage
--
-- defineCounter "vm.txs_processed" [("vm_type", "evm")]
-- defineTimer "vm.run_loop" [("vm_type", "evm")]
-- # quasiquotes out to
-- # vm_txs_processed = Counter { counterName = "vm.txs_processed", counterTags = [("vm_type", "evm")] }
--
-- # then you just use it inside a transformed monad
-- flip runStatsT myConfig . forever $ do
-- start <- liftIO getTime
-- tickBy 20 vm_txs_processed -- whoo so fast
-- threadDelay 1000 -- crunchin real numbers here buddy!
-- tick vm_txs_processed
-- threadDelay 10000 -- oh noes a ddos
-- done <- liftIO getTime
-- time (done - start) vm_run_loop