#!/bin/bash # set SVNPATH to the root of your SVN code working copy SVNPATH=${HOME}/develop/trunk/subversion # if using the installed svn, you may need to adapt the following: SVN=${SVNPATH}/svn/svn SVNADMIN=${SVNPATH}/svnadmin/svnadmin SVNSERVE=${SVNPATH}/svnserve/svnserve # set your data paths here WC=/dev/shm/wc REPOROOT=/mnt/archive/svnroot # number of items per folder on the first run. It will be doubled # after every iteration. The test will stop if MAXCOUNT has been # reached or exceeded. FILECOUNT=1 MAXCOUNT=20000 # only 1.7 supports server-side caching and uncompressed data transfer SERVEROPTS="-c 0 -M 1000" # SERVEROPTS="" # from here on, we should be good REPONAME=dirs PORT=54321 URL=svn://localhost:$PORT/$REPONAME TIMEFORMAT=$'%3R %3U %3S' # create repository rm -rf $WC $REPOROOT/$REPONAME mkdir $REPOROOT/$REPONAME ${SVNADMIN} create $REPOROOT/$REPONAME echo -e "[general]\nanon-access = write\n" > $REPOROOT/$REPONAME/conf/svnserve.conf # fire up svnserve ${SVNSERVE} -Tdr /mnt/archive/svnroot/ ${SERVEROPTS} --listen-port ${PORT} --foreground & PID=$! # print header echo -n "using " ${SVN} --version | grep " version" echo # init working copy rm -rf $WC ${SVN} co $URL $WC > /dev/null # main loop while [ $FILECOUNT -lt $MAXCOUNT ]; do echo "Processing $FILECOUNT files in the same folder" echo -ne "\tCreating files ... \t real user sys\n" mkdir $WC/$FILECOUNT for i in `seq 1 ${FILECOUNT}`; do echo "File number $i" > $WC/$FILECOUNT/$i done echo -ne "\tAdding files ... \t" time ${SVN} add $WC/$FILECOUNT > /dev/null echo -ne "\tRunning status ... \t" time ${SVN} st $WC/$FILECOUNT > /dev/null echo -ne "\tCommit files ... \t" time ${SVN} ci $WC/$FILECOUNT -m "" > /dev/null echo -ne "\tListing files ... \t" time ${SVN} ls $URL/$FILECOUNT -v > /dev/null echo -ne "\tUpdating files ... \t" time ${SVN} up $WC/$FILECOUNT > /dev/null rm -rf $WC mkdir $WC echo -ne "\tCheck out all ... \t" time ${SVN} co $URL $WC > /dev/null let FILECOUNT=2*FILECOUNT echo "" done # tear down echo "killing svnserve ... " kill $PID