_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
}
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
}
# "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 }'
BONNIE_FILESIZE=${BONNIE_FILESIZE:=500M}
BONNIE_CHUNKSIZE=${BONNIE_CHUNKSIZE:=1K}
+[ -z "$here" ] && here=`pwd`
. $here/common.bonnie
#
#
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
BONNIE_KFILES=${BONNIE_KFILES:=8}
BONNIE_FILETYPE=${BONNIE_FILETYPE:=regular}
+[ -z "$here" ] && here=`pwd`
. $here/common.bonnie
#
#
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
# %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