Analyzing IRC Trends with Munin
Background
A few months ago I started exploring ways of visualizing information about our IRC channel activity. IRC is a fast paced communication medium that doesn’t lend itself to being measured at-a-glance. Sure, many of us use plugins to tell us what the most number of people in a channel has been, but once that number has been surpassed the previous value is gone forever.
Enter Munin. Munin is marketed as a tool to track resource usage on networked computers. Munin is structured as follows: All of the computers that you wish to receive data from get the munin-node service installed. Each of these nodes has its can have its own unique configuration and set of plugins. Every 5 minutes the Munin server reaches out to all of the nodes and queries them for new data.
Munin can be easily extended by writing scripts in nearly any language, they just need to be able to respond to a few key commands. If sent the ‘config’ command, the script needs to be able to report the properties of the graph(s) that it would normally provide data for. In any other circumstance, the script just reports back data.
Before embarking on trying to collect IRC data, I thought I would write a plugin to capture data that I could easy access. A while ago I wrote a supybot plugin called Wunder that pulls weather data from WeatherUnderground‘s API. By reusing the python that I had written to access their API, I quickly constructed a script that could output the weather data in a form that Munin was able to understand. After watching the data accumulate for a while, I decided to was time to work on the real meat of the project.
On the IRC side my first thought was to use a bot to monitor the channels I was interested in. Even though it wouldn’t be interactive, I wasn’t keen on needing to maintain another connection to freenode. Since I would be collecting information on channels I was already in, it seemed logical to use an irssi script to report channel statistics. I am by no means a perl guru, but I was able to hack at chanpeak.pl to record the current number of users to a file. Using similar logic to this script, I was also able to put together plugins that recorded channel activity and number of bans.
Trends
I’ve been running my Munin instance since the beginning of the year. The data isn’t completely clean, as there were a few mis configurations that I noted after I got it running. Feel free to peruse what I’ve collected at status.nullcortex.com
The easiest trend to spot on the graphs is that while channel population stays roughly the same, most of the channels see a regular rise and fall every 24 hours. #ubuntu is the largest channel we have, and also sees the most change:

#ubuntu - 24 hour population cycle
Strangely, the populations of #ubuntu-devel and #ubuntu-motu both drop during the weekends:
I just spotted this trend recently. The number of users in #ubuntu-devel drops noticibly during UDS:

#ubuntu-devel - Note the drops during UDS at the beginning of May, and end of October.
I can’t forget the striking population changes leading up to a release:


Ubuntu IRC Channels - Year to date
Code
So.. you want to make your own? Munin is in the Ubuntu repositories. The code for the graphs and the modified irssi scripts can be browsed here, or branched: bzr branch lp:~bnrubin/+junk/munin-plugins

