From f351c3c1ecf30bd88b9246d45ba39cd259047a3c Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 11 Jun 2017 12:05:59 +0200 Subject: [PATCH] benchmark.bash: add dd-only mode, enable via "-dd" Allows for quickly testing the streaming write throughput. --- benchmark.bash | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/benchmark.bash b/benchmark.bash index b1c334e..8bc6abb 100755 --- a/benchmark.bash +++ b/benchmark.bash @@ -8,12 +8,13 @@ MYNAME=$(basename "$0") source tests/fuse-unmount.bash function usage { - echo "Usage: $MYNAME [-encfs] [-openssl=true] [-openssl=false] [DIR]" + echo "Usage: $MYNAME [-encfs] [-openssl=true] [-openssl=false] [-dd] [DIR]" } OPT_ENCFS=0 OPT_OPENSSL="" OPT_DIR="" +DD_ONLY="" while [[ $# -gt 0 ]] ; do case $1 in @@ -30,6 +31,9 @@ while [[ $# -gt 0 ]] ; do -openssl=false) OPT_OPENSSL="-openssl=false" ;; + -dd) + DD_ONLY=1 + ;; -*) echo "Invalid option: $1" usage @@ -74,5 +78,11 @@ fi trap "cd /; fuse-unmount -z $MNT; rm -rf $CRYPT $MNT" EXIT # Benchmarks -./tests/canonical-benchmarks.bash $MNT +if [[ $DD_ONLY -eq 1 ]]; then + echo -n "WRITE: " + dd if=/dev/zero of=$MNT/zero bs=131072 count=2000 2>&1 | tail -n 1 + rm $MNT/zero +else + ./tests/canonical-benchmarks.bash $MNT +fi