mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
28 lines
540 B
Bash
Executable File
28 lines
540 B
Bash
Executable File
#!/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 }'
|