ekg-push: Small framework to push metric deltas to a broadcast channel using the ekg-core library.

[ bsd3, library, system ] [ Propose Tags ] [ Report a vulnerability ]

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


[Skip to Readme]

Modules

[Index]

Flags

Automatic Flags
NameDescriptionDefault
examples

build the example program

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.2, 0.0.3
Change log CHANGES.md
Dependencies base (>=4.5 && <4.9), bytestring (<1.0), ekg-core (>=0.1 && <0.2), ekg-push (==0.0.3), text (<1.3), time (<1.5), unordered-containers (<0.3) [details]
License BSD-3-Clause[multiple license files]
Author Andrew Darqui
Maintainer andrew.darqui@gmail.com
Category System
Home page https://github.com/adarqui/ekg-push
Bug tracker https://github.com/adarqui/ekg-push/issues
Source repo head: git clone https://github.com/adarqui/ekg-push.git
Uploaded by adarqui at 2015-06-06T18:34:26Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables basic
Downloads 1633 total (2 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-06-09 [all 1 reports]

Readme for ekg-push-0.0.3

[back to package description]

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:

  • ekg-push-redis
  • ekg-push-file
  • ekg-push-statsd
  • ekg-push-uberlog

etc..

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.

Installation

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

cabal install ekg-push

Getting started

make examples
./.cabal-sandbox/bin/basic

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]
            Counter.inc iters
            threadDelay 2000
            loop n

    loop 1000000

-- adarqui