From: fsgqa Date: Tue, 9 Sep 2003 01:50:09 +0000 (+0000) Subject: Make bench script output clearer for people reading the output first thing in the... X-Git-Tag: v1.1.0~924 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=25fcdbf2495e548308d9edc5fb30018a36268227;p=users%2Fhch%2Fxfstests-dev.git Make bench script output clearer for people reading the output first thing in the morning. ;) --- diff --git a/bench b/bench index c701c7412..968237f8c 100755 --- a/bench +++ b/bench @@ -133,8 +133,7 @@ _run_benchmark() _merge_results() { echo Results for $bench benchmark - headers=`$here/run.$bench -h` - echo "[$headers]" + $here/run.$bench -h echo results.$bench.* | sort -nu | xargs cat echo } diff --git a/common.bonnie b/common.bonnie index f3b7ccfbb..a1cccc141 100644 --- a/common.bonnie +++ b/common.bonnie @@ -8,12 +8,12 @@ run_bonnie() mkdir ./bonnie || exit 1 defaults="-d ./bonnie -q -f -r 0" defaults="$defaults -u "`id -u`" -g "`id -g` - bonnie++ -m '' $defaults $@ >$tmp/bonnie.stdout 2>$tmp/bonnie.stderr + bonnie++ -m '' $defaults $@ >$tmp/$$.bonnie.stdout 2>$tmp/$$.bonnie.stderr status=$? rm -fr ./bonnie [ $status -ne 0 ] && exit 1 - filter_stdout < $tmp/bonnie.stdout - filter_stderr < $tmp/bonnie.stderr 1>&2 + filter_stdout < $tmp/$$.bonnie.stdout + filter_stderr < $tmp/$$.bonnie.stderr 1>&2 rm -f $tmp/bonnie.stdout $tmp/bonnie.stderr exit 0 } diff --git a/common.dbench b/common.dbench index d5fabb1af..d3cd53438 100755 --- a/common.dbench +++ b/common.dbench @@ -21,7 +21,7 @@ run_dbench() # "Throughput 40.6701 MB/sec (NB=50.8376 MB/sec 406.701 MBit/sec)" # if [ $# -gt 0 ]; then - echo "clients,MB/sec" + printf "%8s, %s\n" clients MB/sec exit 0 fi -run_dbench | awk 'END { printf "%u,%s\n", '$DBENCH_CLIENTS', $2 }' +run_dbench | awk 'END { printf "%8u, %s\n", '$DBENCH_CLIENTS', $2 }' diff --git a/run.bonnie_io b/run.bonnie_io index fb08396d5..8d0be806e 100755 --- a/run.bonnie_io +++ b/run.bonnie_io @@ -8,6 +8,7 @@ BONNIE_FILESIZE=${BONNIE_FILESIZE:=500M} BONNIE_CHUNKSIZE=${BONNIE_CHUNKSIZE:=1K} +[ -z "$here" ] && here=`pwd` . $here/common.bonnie # @@ -28,11 +29,22 @@ filter_stderr() # filter_stdout() { - tr -s ',' | sed -e 's/^,//' -e 's/,$//' + perl -ne ' + chomp; + s/,+/,/g; s/^,//; s/,$//; + @values = split /,/; + printf "%9s", shift @values; + for ($i = 0; $i <= $#values; $i++) { + if ($i % 2) { printf ",%4s%%", $values[$i] } + else { printf ",%10s", $values[$i] } + } + printf "\n"; + ' } if [ $# -gt 0 ]; then - echo "size:chnk,writeK/s,wCPU,rewriteK/s,rwCPU,readK/s,rCPU,seek/s,sCPU" + printf "%9s,%10s,%5s,%10s,%5s,%10s,%5s,%10s,%5s\n" size:chnk \ + writeK/s wCPU rewriteK/s rwCPU readK/s rCPU seek/s sCPU exit 0 fi run_bonnie -n 0 -s $BONNIE_FILESIZE:$BONNIE_CHUNKSIZE diff --git a/run.bonnie_ops b/run.bonnie_ops index 1120ef699..a4e9850df 100755 --- a/run.bonnie_ops +++ b/run.bonnie_ops @@ -15,6 +15,7 @@ BONNIE_NDIRS=${BONNIE_NDIRS:=1} BONNIE_KFILES=${BONNIE_KFILES:=8} BONNIE_FILETYPE=${BONNIE_FILETYPE:=regular} +[ -z "$here" ] && here=`pwd` . $here/common.bonnie # @@ -37,11 +38,22 @@ filter_stderr() # filter_stdout() { - tr -d '+' | tr -d \' | tr -s ',' | sed -e 's/^,//' -e 's/,$//' + perl -ne ' + chomp; + s/\+*//g; s/,+/,/g; s/^,//; s/,$//; + @values = split /,/; + printf "%9s", 1024 * shift @values; + for ($i = 0; $i <= $#values; $i++) { + if ($i % 2) { printf ",%4s%%", $values[$i] } + else { printf ",%10s", $values[$i] } + } + printf "\n"; + ' } if [ $# -gt 0 ]; then - echo Kfiles/dirs,seqCR/s,scCPU,seqRM/s,srCPU,rndmCR/s,rcCPU,rndmRM/s,rrCPU + printf "%9s,%10s,%5s,%10s,%5s,%10s,%5s,%10s,%5s\n" files \ + seqCR/s scCPU seqRM/s srCPU randCR/s rcCPU randRM/s rrCPU exit 0 fi diff --git a/run.tar b/run.tar index 4c71d772c..74c65406d 100755 --- a/run.tar +++ b/run.tar @@ -24,16 +24,16 @@ run_tar() # %U=user %S=system %E=elapsed mkdir ./tar || exit 1 size=`ls -Llh $TARFILE | awk '{print $5}'` - time=`/usr/bin/time -f '%U,%S,%E' tar xzf $TARFILE 2>&1` + time=`/usr/bin/time -f '%U, %S, %E' tar xzf $TARFILE 2>&1` status=$? cd .. rm -fr ./tar [ $status -eq 0 ] || exit 1 - echo "$size,$time" + printf "%6s, %s\n" "$size" "$time" } if [ $# -gt 0 ]; then - echo "sz,usr,sys,real" + printf "%6s,%5s,%5s,%8s\n" sz usr sys real exit 0 fi new_tar