Files
apfstests/common/perf
T
Josef Bacik c134a345f7 fstests: add fio perf results support
This patch does the nuts and bolts of grabbing fio results and
storing them in a database in order to check against for future
runs.  This works by storing the results in resuts/fio-results.db as
a sqlite database.  The src/perf directory has all the supporting
python code for parsing the fio json results, storing it in the
database, and loading previous results from the database to compare
with the current results.

This also adds a PERF_CONFIGNAME option that must be set for this to
work.  Since we all have various ways we run fstests it doesn't make
sense to compare different configurations with each other (unless
specifically desired).  The PERF_CONFIGNAME will allow us to
separate out results for different test run configurations to make
sure we're comparing results correctly.

Currently we only check against the last perf result.  In the future
I will flesh this out to compare against the average of N number of
runs to be a little more complete, and hopefully that will allow us
to also watch latencies as well.

[eguan: add required Makefile updates]

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2017-11-26 15:37:22 +08:00

41 lines
937 B
Plaintext

#
# Common perf specific functions
#
_require_fio_results()
{
if [ -z "$PERF_CONFIGNAME" ]
then
_notrun "this test requires \$PERF_CONFIGNAME to be set"
fi
_require_command $PYTHON2_PROG python2
$PYTHON2_PROG -c "import sqlite3" >/dev/null 2>&1
[ $? -ne 0 ] && _notrun "this test requires python sqlite support"
$PYTHON2_PROG -c "import json" >/dev/null 2>&1
[ $? -ne 0 ] && _notrun "this test requires python json support"
_require_command $SQLITE3_PROG sqlite3
}
_fio_results_init()
{
cat $here/src/perf/fio-results.sql | \
$SQLITE3_PROG $RESULT_BASE/fio-results.db
[ $? -ne 0 ] && _fail "failed to create results database"
[ ! -e $RESULT_BASE/fio-results.db ] && \
_fail "failed to create results database"
}
_fio_results_compare()
{
_testname=$1
_resultfile=$2
$PYTHON2_PROG $here/src/perf/fio-insert-and-compare.py \
-c $PERF_CONFIGNAME -d $RESULT_BASE/fio-results.db \
-n $_testname $_resultfile
}