Small and furry, well ... definitely furry. [source]

Friday, April 15, 2011

Graphing Metrics

At work, we have a lot of metrics. These really help us diagnose problems when things go South. On of the conventions is that every server exposes a URL for metrics in plain text, where every line is in the format "metric: value".

You can track a metric simply by running

watch 'curl -s localhost:8001/metrics | grep metric2'
However this will only bring you the current value. I personally prefer graphs, so I wrote this little Clojure application that let you pick URLs and metrics to follow, then displays graphs for these metrics. It's a small web server where the UI is the browser (which will open automagically when you run the program).

Here's the main screen:

And here's the configuration screen

What's nice about this project is that you can build a single "uberjar" and give it away to people.

Technologies used:
As usual, the sources at at bitbucket

(Note that the demo server there also have a dummy /metrics handler that generate random metrics).

No comments:

Post a Comment