Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module lets you periodically flush metrics to a log file that automatically rotates itself.
main = do store <- newStore forkEkgLog defaultLogOptions 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.
- data Log
- logThreadId :: Log -> ThreadId
- forkEkgLog :: LogOptions -> Metrics.Store -> IO Log
- data LogOptions = LogOptions {}
- defaultLogOptions :: LogOptions
The log syncer
A handle that can be used to control the log sync thread.
Created by forkEkgLog
.
logThreadId :: Log -> ThreadId Source
The thread ID of the log sync thread. You can stop the sync by killing this thread (i.e. by throwing it an asynchronous exception.)
:: LogOptions | Options |
-> Metrics.Store | Metric store |
-> IO Log | Log sync handle |
Create a thread that periodically flushes the metrics in the store to a log file.
data LogOptions Source
Options to control whate log file to append to, when to rotate, and how often to flush metrics. The flush interval should be shorter than the flush interval.
LogOptions | |
|
defaultLogOptions :: LogOptions Source
Defaults:
logfile
="./ekg.log"
flushInterval
=5000
debug
=False