rgacogne / metronome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

metronome

Mini-graphite so we can ship pdnscontrol w/o depending on graphite.

'metronome' implements the carbon protocol, so anything that can feed Graphite can feed metronome. We also accept submissions via POST:

For example, to submit RX bytes for eth0:

while true; 
do
    VAL=$(ip -s link ls eth0 | grep RX -A 1 | tail -1 | awk '{print $1}')
    wget -q --post-data="" "http://127.0.0.1:8000/?do=store&name=rxbytes&timestamp=$(date +%s)&value=$VAL" -O /dev/null
    sleep 1
done

To retrieve data:

$ wget http://127.0.0.1:8000/?do=retrieve&name=rxbytes&begin=0&end=$(date +%s)&callback=jsonp

This delivers a JSONP callback with your values in there.

To view, try html/index.html

Installing

Dependencies include a recent g++ (4.7+) and libboost.

Either install libeigen3-dev (Debian, Ubuntu), eigen3-devel (Fedora, EPEL), or:

$ wget http://bitbucket.org/eigen/eigen/get/3.2.1.tar.bz2
$ tar xf 3.2.1.tar.bz2
$ ln -s eigen-eigen-*/Eigen .

Now configure yahttp:

$ cd yahttp
$ ./autogen.sh
$ ./configure
$ cd -

Then:

$ make
$ ./metronome --help
$ mkdir stats
$ ./metronome --stats-directory=./stats

Next, host the 'html/' directory somewhere on a webserver, and edit 'html/local.js' so it knows the Webserver IP address of metronome (port 8000 on :: by default).

Thanks to

Aki Tuomi for the excellent yahttp, Rickshaw for the graphs. Eigen for the math. And a cast of thousands for C++2011.

status

"Toy" for now - stores all data in flat files, which we read in their entirety to replay data.

But, starting to look nice.

About

License:GNU General Public License v2.0


Languages

Language:Shell 54.8%Language:C++ 25.0%Language:JavaScript 15.7%Language:C 2.0%Language:CSS 1.5%Language:HTML 0.6%Language:Makefile 0.4%Language:Assembly 0.1%