3 #check dbench is installed
4 if [ "`whereis dbench`" == "dbench:"]; then
5 echo $0 error dbench not installed.
11 mkdir ./dbench || exit 1
17 [ $status -ne 0 ] && exit 1
21 # Sample dbench output:
22 # "Throughput 40.6701 MB/sec (NB=50.8376 MB/sec 406.701 MBit/sec)"
25 # Output for a single-shot dbench run.
28 printf "%8s, %s\n" clients MB/sec
33 perl -ne 'm/Throughput (\S+) MB\/sec/ &&
34 { printf "%8u, %s\n", '$clients', $1 }'
37 # Output for a "multipass" dbench run.
38 _format_header_multipass()
40 while [ $# -gt 1 ]; do
41 printf "%4s::MB/sec," $1
44 printf "%4s::MB/sec\n" $1
46 _filter_dbench_multipass()
49 if (m/Throughput (\S+) MB\/sec/) {
50 $results[$count++] = $1;
52 END { for ($i = 0; $i < $count - 1; $i++) {
53 printf "%12.3f,", $results[$i];
55 printf "%12.3f\n", $results[$count-1];