Subversion load and performance testing in 10 lines or less?

This short post shares a compact shell script for load and performance testing Subversion checkouts with configurable run count and parallelism. It also explains how the script captures timing data and produces CSV output for quick analysis.

Coveros Staff

November 26, 2012

I needed a quantifiable test that can measure svn performance during a check out. This script take 2 arguments, number of checkouts and parallelism. For example, if I want to run 100 checkout 2 at a time ./load.sh 100 2 or 100 checkouts 50 at a time ./load.sh 100 50

#!/bin/bash

i=0;

url="<a href="http://mysvnrepo"

while">http://mysvnrepo"

while</a> [ $i -lt $1 ]; do mkdir $i; let i=$i+1; done

DATE=date +%m%d%y%H%M%S;

find -type d ! -name . -maxdepth 1 2> /dev/null | sed "s/\.\///g" \ | xargs -I'{}' -P$2 time -o {}/time.dat svn co $url {}

find -iname time.dat -exec cat {} >> total_$1_$2_$DATE.dat \;

cat total_$1_$2_$DATE.dat | grep -v swaps | sed "s/user /\t/g" \ | sed "s/system /\t/g" | sed "s/ elapsed.*//g" | sort -n > res_$1_$2_$DATE.csv

i=0;

while [ $i -lt $1 ] ; do rm -rf $i; let i=$i+1; done

The results are recorded in a file with both test parameters and the date. A little bit of sed magic and you can create a csv which will make pretty graphs in Microsoft Excel or LibreOffice Calc. Enjoy.

Coveros Staff

Coveros Staff

This post represents the collective insights of the Coveros team. Our staff consists of software experts who bring deep experience in secure agile development, DevOps, testing, and software quality. Over the past 20 years, Coveros has trained more than 30,000 professionals and worked with half of the Fortune 100 companies on mission-critical software development challenges. We draw on this extensive experience to share practical insights, proven strategies, and real-world solutions that help organizations build better software faster and more securely.