Friday, April 08, 2005

StatCVS on Mac OS X

StatCVS is a slick CVS statistics generation utility. Previously I ran this from cron on a FreeBSD system on my LAN that then uploaded the results to my web site. I figured I would give it a shot on my Mac since it should run nicely on it.

StatCVS output on my web site

Setup was truly painless. Java was already installed, so I just had to download the single jar file from the StatCVS site and unzip it into the directory I created for this purpose. I changed the paths in the shell scripts I used on FreeBSD to match the paths on OS X, added them to my crontab (same process as in FreeBSD), and it's running great.

Blows away my Pentium 4 1.6 GHz FreeBSD box that was running it. It took from 45 seconds to upwards of a minute depending on the size of the repository. My 1.42 GHz G4 takes 10-15 seconds tops. Of course you can't compare clock speed between the two, and a P4 1.6 is a *much* cheaper system than the Mac mini, but I was impressed regardless because I wasn't expecting that much of a performance increase.

Example of the scripts I use to generate StatCVS:
#!/bin/bash
# update from CVS
cd /Users/cmb/statcvs/cvsroot/m0n0wall && /usr/bin/cvs -d \ :pserver:anonymous@m0n0.ch:/m0n0wall co doc
# generate CVS logs
cd /Users/cmb/statcvs/cvsroot/m0n0wall/doc && /usr/bin/cvs log > cvs-log
# generate StatCVS output
cd /Users/cmb/statcvs/output/m0n0wall && java -jar \ /Users/cmb/statcvs/statcvs.jar \ /Users/cmb/statcvs/cvsroot/m0n0wall/doc/cvs-log \ /Users/cmb/statcvs/cvsroot/m0n0wall/doc/
# upload to web site
scp -r /Users/cmb/statcvs/output/m0n0wall/ \ user@server:/usr/local/www/statcvs/m0n0wall/
I use SSH DSA keys so passwords don't need to be entered (otherwise it wouldn't run from cron).

0 Comments:

Post a Comment

<< Home