[BACK]Return to common.dbench CVS log [TXT][DIR] Up to [Development] / xfs-cmds / xfstests

File: [Development] / xfs-cmds / xfstests / common.dbench (download)

Revision 1.2, Tue Sep 9 01:50:09 2003 UTC (14 years, 1 month ago) by fsgqa
Branch: MAIN
Changes since 1.1: +2 -2 lines

Make bench script output clearer for people reading the output first thing in the morning. ;)

#!/bin/sh
# 
# Does a dbench run (10 clients if $DBENCH_CLIENTS is not set),
# then massages the output into CSV format.
# 
DBENCH_CLIENTS=${DBENCH_CLIENTS:=10}

run_dbench()
{
	mkdir ./dbench || exit 1
	cd dbench
	dbench $DBENCH_CLIENTS
	status=$?
	cd ..
	rm -fr ./dbench
	[ $status -ne 0 ] && exit 1
}

# 
# Sample dbench output:
# "Throughput 40.6701 MB/sec (NB=50.8376 MB/sec  406.701 MBit/sec)"
# 
if [ $# -gt 0 ]; then
	printf "%8s, %s\n" clients MB/sec
	exit 0
fi
run_dbench | awk 'END { printf "%8u, %s\n", '$DBENCH_CLIENTS', $2 }'