Safe Haskell | None |
---|---|
Language | Haskell2010 |
Simple API for passing ekg monitoring statistics to a round-robin database
(RRD) using rrdtool
.
- type IntervalSeconds = Int
- type SourceValue = Int64
- data DataSource = DataSource {}
- data DataSourceType
- gcSources :: IntervalSeconds -> [DataSource]
- data ConsolidationFunction
- data RoundRobinArchive = RoundRobinArchive {}
- data RoundRobinDatabase
- newRRD :: FilePath -> IntervalSeconds -> Maybe FilePath -> [RoundRobinArchive] -> [DataSource] -> IO RoundRobinDatabase
- rrdStore :: RoundRobinDatabase -> Store
- data MonitorThread
- runMonitor :: RoundRobinDatabase -> IO MonitorThread
- killMonitor :: MonitorThread -> IO ()
- nullMonitor :: MonitorThread
Basic Types
type IntervalSeconds = Int Source
Intervals in seconds (e.g. heartbeats and step size)
type SourceValue = Int64 Source
Counters, gauges etc. in ekg
have this type
Data Sources
data DataSource Source
A data source in a round-robin database.
DataSource | |
|
data DataSourceType Source
Types of data source in a round-robin database.
:: IntervalSeconds | The heartbeat for these metrics, in seconds. |
-> [DataSource] |
Pre-defined data sources for tracking GHC's GC metrics. See registerGcMetrics
or GCStats
for more details.
Clients must run registerGcMetrics
to register these metrics once the RRD is created.
Round Robin Archives
data ConsolidationFunction Source
Defines how multiple primary data points (PDPs) are turned into a
consolidated data point (CDP) for storage in a RoundRobinArchive
.
data RoundRobinArchive Source
A sequence of consolidated data points (CDPs).
RoundRobinArchive | |
|
Round Robin Databases
data RoundRobinDatabase Source
A round-robin database (RRD), which is a file on disk that stores time series data from a number of sources.
:: FilePath | The name of the database file. |
-> IntervalSeconds | The update interval in seconds. |
-> Maybe FilePath | A path to the |
-> [RoundRobinArchive] | Round-robin archives that define how data is stored. |
-> [DataSource] | Data sources to define in the database. |
-> IO RoundRobinDatabase |
Create a new RoundRobinDatabase
. Creates the database file on disk if
not already present. Metrics must subsequently be registered in the store
associated with the RoundRobinDatabase
, which can be obtained with
rrdStore
. Throws an IOException
if there was a problem running rrdtool
.
rrdStore :: RoundRobinDatabase -> Store Source
Get the Store
associated with this RoundRobinDatabase
in order to register metrics.
Monitoring Thread
data MonitorThread Source
The monitoring thread for a round robin database, which can be created
with runMonitor
and killed with killMonitor
.
runMonitor :: RoundRobinDatabase -> IO MonitorThread Source
Run a monitoring thread for the given database, which samples the metrics and updates the database at the chosen frequency. Failed updates are ignored.
killMonitor :: MonitorThread -> IO () Source
Kills the monitoring thread.
nullMonitor :: MonitorThread Source
A do-nothing MonitorThread, for use if monitoring is disabled.