Simple Website Monitoring using Clojure

Simple Website Monitoring using Clojure

Ad-hoc measurement of page load times across multiple web servers can be a drag. Quite often you end up with a number of screen windows doing bash timed curl loops with file redirects and some grep/awk magic. This tends to work OK until you need to get a bit more sophisticated, for example - compare results or get samples at fixed frequency.

Here we give a quick-and-dirty Clojure script that takes that curl loop just a bit further - from a single command you can monitor response times across arbitrary number of endpoints, retrieving measurements at given time intervals and track results in real-time. The script itself is trivial - most of the functionality is due to Quartzite scheduling library. You can grab the source at:

https://github.com/SupplyFrame/grunf

example usage:

lein run -m grunf.bin '(["http://www.google.com" "http://finance.yahoo.com" "http://www.bing.com/news"] 1000)'

(1368072742623 http://www.google.com 225.029)
(1368072743236 http://www.bing.com/news 839.584)
(1368072743457 http://finance.yahoo.com 1059.564)
...

Have fun !

Leave a Reply

Your email address will not be published. Required fields are marked *