Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module lets you periodically flush metrics to a statsd backend. Example usage:
main = do store <- newStore forkStatsd defaultStatsdOptions store
You probably want to include some of the predefined metrics defined
in the ekg-core package, by calling e.g. the registerGcStats
function defined in that package.
Note that the StatsD protocol does not allow
in metric names, so
any occurrences are replaced by :
'_'
.
Synopsis
- data Statsd
- statsdFlush :: Statsd -> IO ()
- statsdThreadId :: Statsd -> ThreadId
- forkStatsd :: StatsdOptions -> Store -> IO Statsd
- data StatsdOptions = StatsdOptions {}
- defaultStatsdOptions :: StatsdOptions
The statsd syncer
A handle that can be used to control the statsd sync thread.
Created by forkStatsd
.
statsdFlush :: Statsd -> IO () Source #
Flush a sample to the statsd server
Since: 0.2.3.0
statsdThreadId :: Statsd -> ThreadId Source #
The thread ID of the statsd sync thread. You can stop the sync by killing this thread (i.e. by throwing it an asynchronous exception.)
:: StatsdOptions | Options |
-> Store | Metric store |
-> IO Statsd | Statsd sync handle |
Create a thread that periodically flushes the metrics in the store to statsd.
data StatsdOptions Source #
Options to control how to connect to the statsd server and how often to flush metrics. The flush interval should be shorter than the flush interval statsd itself uses to flush data to its backends.
StatsdOptions | |
|
defaultStatsdOptions :: StatsdOptions Source #
Defaults:
host
="127.0.0.1"
port
=8125
flushInterval
=1000
debug
=False