Files
apfstests/common.dbench
T

52 lines
854 B
Plaintext
Raw Normal View History

2003-09-25 01:57:56 +00:00
##/bin/sh
2003-09-25 01:57:56 +00:00
_run_dbench()
{
mkdir ./dbench || exit 1
cd dbench
2003-09-25 01:57:56 +00:00
dbench $1
status=$?
cd ..
rm -fr ./dbench
[ $status -ne 0 ] && exit 1
}
2003-09-25 01:57:56 +00:00
#
# Sample dbench output:
# "Throughput 40.6701 MB/sec (NB=50.8376 MB/sec 406.701 MBit/sec)"
#
2003-09-25 01:57:56 +00:00
# Output for a single-shot dbench run.
_format_header()
{
printf "%8s, %s\n" clients MB/sec
2003-09-25 01:57:56 +00:00
}
_filter_dbench()
{
clients=$1
perl -ne 'm/Throughput (\S+) MB\/sec/ &&
{ printf "%8u, %s\n", '$clients', $1 }'
}
# Output for a "multipass" dbench run.
_format_header_multipass()
{
2003-09-25 02:27:04 +00:00
while [ $# -gt 1 ]; do
printf "%4s::MB/sec," $1
shift
2003-09-25 01:57:56 +00:00
done
2003-09-25 02:27:04 +00:00
printf "%4s::MB/sec\n" $1
2003-09-25 01:57:56 +00:00
}
_filter_dbench_multipass()
{
perl -ne '
if (m/Throughput (\S+) MB\/sec/) {
$results[$count++] = $1;
}
END { for ($i = 0; $i < $count - 1; $i++) {
printf "%12.3f,", $results[$i];
}
printf "%12.3f\n", $results[$count-1];
}'
}