Stats aggregator in haskell
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



statskell is a daemon that collects statistics and propagates them to a proper db. It came to be after reading Measure anything, measure everything article. The purpose is to have a simple interface for counting 'stuff'. For example you can record failed and successful login attempts of your site. If there is a weird spike in the failed login attempts, you can probably assume that there has been some sort of hacking attempt. Another use-case is for example calculating how many emails you receive within a timeperiod. I have a fetchmail/procmail setup, and I can increase the counter from within procmail when any email arrive, statskell then flushes the received counter to rrdtool.

statskell works by receiving udp messages, aggregating them and then flushing them out after a 10 second period. It flushes the aggregated stats into a database. I chose rrdtool as the backend because it handles graphing and its database is constant size. If you want to read more about it, go to [](rrdtool website).


statskell is in alpha-stage, but it should be stable enough. All you need to is to create the rrdtool database and start the server. It listens on port 4242 udp packets and writes the results into stats.rrd file into the directory where the server has been started.


The protocol is a simple 4 column protocol separated by pipe character ('|').


Possible values for the type field:

  • absolute Absolute value. See rrdtool documentation for what it means
  • gauge Gauged value. See rrdtool documentation for what it means

Possible values for the consolidation field:

  • sum Sum together all the values. For example if you get results faster then the flush-delay, the values are added together
  • max Select the maximum of all the values
  • min Select the minimum of all the values
  • average Calculate the average of all the values

Thank you

Thank you for my employer for allowing me to use my time on this project.