Make bench script output clearer for people reading the output first thing in the...
authorfsgqa <fsgqa>
Tue, 9 Sep 2003 01:50:09 +0000 (01:50 +0000)
committerfsgqa <fsgqa>
Tue, 9 Sep 2003 01:50:09 +0000 (01:50 +0000)
bench
common.bonnie
common.dbench
run.bonnie_io
run.bonnie_ops
run.tar

diff --git a/bench b/bench
index c701c74129c090850086fa2a71c737ed619d04d8..968237f8c45dd1be7b10bf2692f2f5710bf6cbe5 100755 (executable)
--- 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
 }
index f3b7ccfbb3ced653561b1a5021c6fa38cfa092c9..a1cccc1413c8d5705427f98e533362989ba98a2e 100644 (file)
@@ -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
 }
index d5fabb1af59b3bcd8b61400bd5ad2e5a2dc661e7..d3cd53438353b3f467caedbb2d9514f56e4eeccb 100755 (executable)
@@ -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 }'
index fb08396d5c9da9dcc4292f1a8d86968f63c1f7e8..8d0be806ef1c702959762eaf07e26b778c57c548 100755 (executable)
@@ -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
index 1120ef6999d47be9d1844bbd9a5d63a0906a5259..a4e9850dfca084b80216e00bbff5efe32d51d546 100755 (executable)
@@ -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 4c71d772cc420780fb4962502a41abdf07b105df..74c65406ddda77a25fe7c6acef2b6a24167cc7f5 100755 (executable)
--- 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