Creating your own code swarm

This is a little guide on how you can create your own code swarm. Code swarm shows the history of commits in a software project. The visualization looks something like this:

Code swarm

For this guide I'll use SVN, but code swarm supports HG and Git as well (and if you are using something exotic, it isn't that hard to build custom converters). I am doing this on Ubuntu, but it should work on Windows/Mac as well (code swarm is implemented in Java).

1) SVN checkout code swarm

$ svn checkout http://codeswarm.googlecode.com/svn/trunk/ codeswarm-read-only

2) Create a log of your repository

$ svn log -v > my_project.log

3) Convert log to uniform XML format

$ cd codeswarm-read-only
$ python convert_logs/convert_logs.py -s #../my_project.log -o data/my_project.xml

4) Edit data/sample_config.config

Replace:

InputFile=data/sample-repevents.xml

with:

InputFile=data/my_project.xml

and replace:

TakeSnapshots=false

with:

TakeSnapshots=true

5) Create frames and generate snapshots

$ mkdir frames
$ ./run.sh

6) Generate AVI file

$ sudo apt-get install mencoder
$ cd frames
$ mencoder "mf://*.png" -mf fps=10 -o test.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=500

7) More on generating videos

How to generate AVI file with sound or generate Flash video, here are some articles from a quick Google search:

An example

Here is Plurk's code swarm:


code_swarm - Plurk from amir salihefendic on Vimeo.

Code · Interesting · Stuff 25. Sep 2008
5 comments so far

In case you're having trouble with this, remember to install openjdk, and not sun's.

Eg.:

sudo apt-get install openjdk-6-jdk

I've got a fork of code_swarm up which is a good bit easier to use (not to mention faster) up here: http://github.com/rictic/code_.... I expect the main code_swarm repository will pull in most of my changes eventually, but they've been rather unresponsive lately.

After you add code_swarm/convert_logs/ to your PATH, visualizing a svn, git, or hg project is as simple as going to the root directory of the project and running code_swarm. It also creates a per-project config file that you can edit for your step 4.

Also, troelskn, in my experience it's the other way around. I've only had luck running code_swarm with sun's jdk. The official documentation agrees: http://code.google.com/p/codes...

If you want an similar visualization for your web server responses check logstalgia.

More info at:
http://debaday.debian.net/2008...

smart

How do I configure the codeswarm so that it shows the histogram at the bottom?

Thanks!

Post a comment
Commenting on this post has expired.
© 2000-2009 amix. Powered by Skeletonz.