whoops, fix a typo in QA test 075
[xfstests-dev.git] / common.dbench
1 #!/bin/sh
2
3 # Does a dbench run (10 clients if $DBENCH_CLIENTS is not set),
4 # then massages the output into CSV format.
5
6 DBENCH_CLIENTS=${DBENCH_CLIENTS:=10}
7
8 run_dbench()
9 {
10         mkdir ./dbench || exit 1
11         cd dbench
12         dbench $DBENCH_CLIENTS
13         status=$?
14         cd ..
15         rm -fr ./dbench
16         [ $status -ne 0 ] && exit 1
17 }
18
19
20 # Sample dbench output:
21 # "Throughput 40.6701 MB/sec (NB=50.8376 MB/sec  406.701 MBit/sec)"
22
23 if [ $# -gt 0 ]; then
24         echo "clients,MB/sec"
25         exit 0
26 fi
27 run_dbench | awk 'END { printf "%u,%s\n", '$DBENCH_CLIENTS', $2 }'