Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Moonshine a
- runMoonshine :: Moonshine a -> IO a
- route :: [(ByteString, Moonshine ())] -> Moonshine ()
- makeTimer :: Text -> Moonshine Timer
- timerAdd :: (Real time, MonadIO io) => Timer -> time -> io ()
- data Timer
- timed :: Text -> Moonshine a -> Moonshine a
- liftSnap :: Snap () -> Moonshine ()
- liftIO :: MonadIO m => forall a. IO a -> m a
- setBanner :: String -> IO ()
- timedIO :: MonadIO io => Timer -> io a -> io a
- makeGauge :: Text -> Moonshine Gauge
- gaugeInc :: MonadIO io => Gauge -> io ()
- gaugeDec :: MonadIO io => Gauge -> io ()
- gaugeSet :: MonadIO io => Gauge -> Int64 -> io ()
- gaugeAdd :: MonadIO io => Gauge -> Int64 -> io ()
- gaugeSubtract :: MonadIO io => Gauge -> Int64 -> io ()
- data Gauge
Documentation
The moonshine monad.
runMoonshine :: Moonshine a -> IO a Source
Execute an insance of the Moonshine monad. This starts up a server and never returns.
route :: [(ByteString, Moonshine ())] -> Moonshine () Source
Like route
, but that automatically sets up metrics for the
specified routes.
Wrap a Moonshine
in a timer, so that timing data for invocations
will be logged to the metrics handler.
timedIO :: MonadIO io => Timer -> io a -> io a Source
Time how long it takes to perform some kind of IO. This function is
compatible with any MonadIO
.
gaugeSet :: MonadIO io => Gauge -> Int64 -> io () Source
Set the gauge the a specific value one from a gauge value.
gaugeSubtract :: MonadIO io => Gauge -> Int64 -> io () Source
Subtrace a value from a gauge.