diff options
author | Josef Bacik <jbacik@fb.com> | 2017-11-16 13:29:59 -0500 |
---|---|---|
committer | Eryu Guan <eguan@redhat.com> | 2017-11-26 15:38:55 +0800 |
commit | e0d95552fdb2948c63b29af4a8169a2027f84a1d (patch) | |
tree | fe69202f79679b6e6f5a87d3ba24e4bb4dbe8014 | |
parent | c134a345f79e13a6c1ec2f273e2c9565d1641508 (diff) | |
download | xfstests-e0d95552fdb2948c63b29af4a8169a2027f84a1d.tar.gz |
perf: a random write buffered fio perf test
This uses the new fio results perf helpers to run a rand write
buffered workload on the scratch device.
[eguan: add Makefile]
Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
-rwxr-xr-x | tests/perf/001 | 80 | ||||
-rw-r--r-- | tests/perf/001.out | 2 | ||||
-rw-r--r-- | tests/perf/Makefile | 20 | ||||
-rw-r--r-- | tests/perf/group | 1 |
4 files changed, 103 insertions, 0 deletions
diff --git a/tests/perf/001 b/tests/perf/001 new file mode 100755 index 0000000000..a9e933df77 --- /dev/null +++ b/tests/perf/001 @@ -0,0 +1,80 @@ +#! /bin/bash +# perf/001 Test +# +# Buffered random write performance test. +# +#----------------------------------------------------------------------- +# (c) 2017 Josef Bacik +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +fio_config=$tmp.fio +fio_results=$tmp.json +status=1 # failure is the default! +trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/perf + +# real QA test starts here +_supported_fs generic +_supported_os Linux +_require_scratch +_require_block_device $SCRATCH_DEV +_require_fio_results + +rm -f $seqres.full + +_size=$((16 * $LOAD_FACTOR)) +cat >$fio_config <<EOF +[t1] +directory=${SCRATCH_MNT} +allrandrepeat=1 +readwrite=randwrite +size=${_size}G +ioengine=psync +end_fsync=1 +fallocate=none +EOF + +_require_fio $fio_config + +_fio_results_init + +# We are going to write at least 16gib, make sure our scratch fs is large enough +# to fit and not deal with any enospc overhead. +_size=$(($_size * 4 * 1024 * 1024)) +_scratch_mkfs >> $seqres.full 2>&1 +_scratch_mount +_require_fs_space $SCRATCH_MNT $_size + +cat $fio_config >> $seqres.full +$FIO_PROG --output-format=json --output=$fio_results $fio_config + +_scratch_unmount +cat $fio_results >> $seqres.full +_fio_results_compare $seq $fio_results +echo "Silence is golden" +status=0; exit diff --git a/tests/perf/001.out b/tests/perf/001.out new file mode 100644 index 0000000000..88678b8ed5 --- /dev/null +++ b/tests/perf/001.out @@ -0,0 +1,2 @@ +QA output created by 001 +Silence is golden diff --git a/tests/perf/Makefile b/tests/perf/Makefile new file mode 100644 index 0000000000..620f1dbff2 --- /dev/null +++ b/tests/perf/Makefile @@ -0,0 +1,20 @@ +# +# Copyright (c) 2017 Red Hat, Inc. All Rights Reserved. +# + +TOPDIR = ../.. +include $(TOPDIR)/include/builddefs + +PERF_DIR = perf +TARGET_DIR = $(PKG_LIB_DIR)/$(TESTS_DIR)/$(PERF_DIR) + +include $(BUILDRULES) + +install: + $(INSTALL) -m 755 -d $(TARGET_DIR) + $(INSTALL) -m 755 $(TESTS) $(TARGET_DIR) + $(INSTALL) -m 644 group $(TARGET_DIR) + $(INSTALL) -m 644 $(OUTFILES) $(TARGET_DIR) + +# Nothing. +install-dev install-lib: diff --git a/tests/perf/group b/tests/perf/group new file mode 100644 index 0000000000..d3ed434926 --- /dev/null +++ b/tests/perf/group @@ -0,0 +1 @@ +001 auto |