Recently I discovered a tool called gitstats, which generates some interesting statistics from commits made to a Git project. I thought it would be fun to reflect on a particular project I have been working on.1
For roughly the past two years I have been working on a web application.2 Actually, gitstats tells me that it has been exactly 456 days.3 I am the only developer on this project. I thought I’d write up on some simple statistics from this project.
The application is a research paper submission and publication system, among other things.
The project program code spans several languages, including:
For features and bugs, there have been 68+ pushes to production, resulting in an internal tag version of 2.6.5, with an average of 37 commits per tag (release).
I tried out this Ruby script that generates stats of inserts/deletions, and the output is:
Git scores (in LOC):
unknown : +3469917 -3150559
I don’t know if any of these details help to paint a picture of the scope of the project, but that’s it.
I have produced substantially more code in 2011 than in 2010, which feels somewhat accurate. I started in august of 2010, so this seems to add-up.
The pattern you might expect happens across the months year; the most work occurs in Autumn where tensions and expectations are high for things to be completed before the end of the year. Winter is expectedly very quiet due to the holidays and effective low demand. Summer, equally, is a very lazy and unproductive time4, partly due to the heat and partly due to holidays.
This result confirmed my suspicions, that I’m most productive in the morning before lunch, and then a little around 5ish. The table below confirms it; I make most commits just before lunch or just after lunch, because I did all the work in the morning. After lunch I’m always very sluggish and lethargic. Somehow it appears I still manage to finish commits I started in the morning. I very rarely work in the evening, though it does happen.
In this case I was surprised. I’d always thought that my productivity was high on average, but very sporadic. I’m aware that some days once in a while I just don’t feel like doing anything/can’t get in the groove.
However, from the chart below it seems that, on average, there is a distinct, and perfectly reasonable pattern.
I think so. It’s true for sure that I can work all day and not commit anything, but on average I break my tasks into smaller tasks that can fit into a few hour’s worth of work and one or two commits.
A commit is a complete piece of work. This is a much better indicator of productivity than merely being at the office, sat at the computer.
I will also say that my stats are very similar to a colleague of mine, on a project of about the same size, who exhibits similar patterns of days of the week, but different hours of the day (he’s more active in the afternoon).
One thing I’ve learned is that my performance is fairly consistently spread in an uneven way. It would be interesting to pace myself better over the week so that I maintain a pace like monday across the board. I’m not sure if this would increase my morale or weaken it.
It might be wise for me to eat smaller meals throughout the day, rather than a big lunch. This seems to really slow me down; I’m not sure whether it’s the full stomach or just a necessary recharge. Also, if I can’t change this pattern, it might be good for me to start scheduling non-coding/hard stuff to that period of the day, such as cleaning up tickets and organizing/planning.
I would be interested to see people’s work patterns based on this gitstats tool for their activity over the year, over the week, and during the day. Especially if you have a year or more worth of data.
As this project has been my main activity and I have two year’s worth of data, there is enough data to generalise my general work.↩
There have been other projects on the side, but mainly it has been this one.↩
2010-07-25 14:36:51 to 2011-10-24 16:45:13 (456 days)↩
Comparatively. In absolute terms that’s still 100+ commits per month.↩
For some value of “good.” Bear in mind that when I talk about “speed” or “good”, I’m talking relatively to the other days, not in absolute terms, your mileage may vary substantially.↩