trivial updates to get more bits to work together.
[xfstests-dev.git] / run.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 || exit 1
13         cd ..
14         rm -fr ./dbench || exit 1
15 }
16
17 # dbench gives:
18 # "Throughput 40.6701 MB/sec (NB=50.8376 MB/sec  406.701 MBit/sec)"
19
20 if [ $# -gt 0 ]; then
21         echo "clients,MB/sec"
22         exit 0
23 fi
24 run_dbench | perl -ne \
25         'if (m/^Throughput (\S+) /) { print '$DBENCH_CLIENTS',",",$1,"\n"; }'
26