Visualizing Small Batch Sizes with Git

I’ve recently finished reading Web Operations: Keeping the Data on Time. Written by John Allspaw and Jesse Robins, by far my favorite chapter was Eric Ries’ submission for Chapter 4: Continuous Deployment. One of the graphs in this chapter compellingly portrays Flickr’s “release early, release often” mantra. This inspired me to start monitoring my own production “drift” – or, what’s the measurable difference between production and the last commit?For the longest time, I’ve used the number of unread items in my Gmail filter “codebase” to tell me how many commits were queueing up for release. It’s trivial to setup, stays visible in the corner of your eye, and it’s especially fulfilling to “select unread” -> “mark as read” after doing a release.

While this is fine for me, what about the team? Or even the company? How could I get this critical information distributed? Eric’s graph showed me just how to do it. I decided to dig this data out and graph it with LogicMonitor.

Here’s a ruby script I wrote to do it. Let’s say your local git repo lives at /src/code/

Notice, I’m adding insertions and deletions to get the total number of lines changed. The resulting string will look something like
sha=afae6e540f5cc55c8a5d4d100d2e5acf22ee2ed5,diff=428

Plotting these values against time, gives you a great overview of your production “drift” from your development repository:
Releases are seen here as line drops and you see we average about one release a day.