Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Metrics.Gauge
Description
A module representing a Gauge, which is simply an action that returns the instantaneous measure of a value for charting.
The action that provides the gauge's value may be replaced using "set", or read using "value".
gaugeExample = do g <- gauge $ return 1 x <- value g set g $ return 2 y <- value g return (x == 1 && y == 2)
Documentation
data Gauge (m :: Type -> Type) Source #
An instantaneous measure of a value.
gauge :: (MonadBase b m, PrimMonad b) => b Double -> m (Gauge b) Source #
Create a new gauge from the given action.
ratio :: Applicative f => f Double -> f Double -> f Double Source #
Compose multiple actions to create a ratio. Useful for graphing percentage information, e. g.
connectionUtilizationRate :: IO (Gauge IO) connectionUtilizationRate = gauge $ ratio openConnectionCount $ return connectionPoolSize
module Data.Metrics.Types