The ekg-push package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.



This library lets you push metric samples to a broadcast channel. Consumers can then persist the samples as they wish.

[Skip to ReadMe]


Versions0.0.2, 0.0.2, 0.0.3
Dependenciesbase (>=4.5 && <4.8), bytestring (<1.0), ekg-core (==, ekg-push (==0.0.2), text (<1.3), time (<1.5), unordered-containers (<0.3) [details]
LicenseBSD3[multiple license files]
AuthorAndrew Darqui
Home page
Bug tracker
Source repositoryhead: git clone
UploadedSun Apr 5 22:10:17 UTC 2015 by adarqui




Maintainers' corner

For package maintainers and hackage trustees

Readme for ekg-push-0.0.2

Modifications of ekg-statsd by Johan Tibell to provide a generic "push" framework.

You will notice this is almost identical to ekg-statsd. It's just me trying to abstract away the basic functionality found in ekg-statsd, so not to have to duplicate this code anywhere else. Eventually I may try to clean up this "abstraction" and create a PR in ekg-core.

TODO: Soon

So, the idea of ekg-push is to create a simple framework so that I can create agents such as:


Push agents simply 'subscribe' to the push handle returned by forkPush. Once subscribed, agents call consume and handle the Metric.Sample data how they want.


You can just type 'make' to install ekg-push into a local sandbox. Or you can use cabal:

cabal install ekg-push

Getting started

See examples/basic.hs

main :: IO ()
main = do
    store <- newStore
    registerGcMetrics store
    iters <- createCounter "iterations" store
    push <- forkPush defaultPushOptions { prefix = "pfx", suffix = "sfx" } store

    ch1 <- subscribe push
    _ <- forkIO $ forever $ do
            msg <- consume ch1
            putStrLn $ "subscription #1: " ++ show  msg

    let loop n = do
            evaluate $ mean [1..n]
            threadDelay 2000
            loop n

    loop 1000000

-- adarqui