From fa62b2add67cedf68bd3fbeb07df3d2a006d2ac9 Mon Sep 17 00:00:00 2001 From: Stefan Chivu Date: Wed, 1 Feb 2023 15:38:52 +0000 Subject: [PATCH] qa: Added latency to results table in test_rbd_wnbd.py Added data regarding completion latency (ns) to the fio results table, such as min, max, mean, stddev, etc. Signed-off-by: Stefan Chivu --- qa/workunits/windows/test_rbd_wnbd.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/qa/workunits/windows/test_rbd_wnbd.py b/qa/workunits/windows/test_rbd_wnbd.py index b64b9fc639baa..c749957cf6550 100644 --- a/qa/workunits/windows/test_rbd_wnbd.py +++ b/qa/workunits/windows/test_rbd_wnbd.py @@ -587,6 +587,16 @@ class RbdFioTest(RbdTest): 'total_ios': job[op]['short_ios'], 'short_ios': job[op]['short_ios'], 'dropped_ios': job[op]['short_ios'], + 'clat_ns_min': job[op]['clat_ns']['min'], + 'clat_ns_max': job[op]['clat_ns']['max'], + 'clat_ns_mean': job[op]['clat_ns']['mean'], + 'clat_ns_stddev': job[op]['clat_ns']['stddev'], + 'clat_ns_10': job[op].get('clat_ns', {}) + .get('percentile', {}) + .get('10.000000', 0), + 'clat_ns_90': job[op].get('clat_ns', {}) + .get('percentile', {}) + .get('90.000000', 0) }) def _get_fio_path(self): @@ -598,7 +608,7 @@ class RbdFioTest(RbdTest): cmd = [ "fio", "--thread", "--output-format=json", "--randrepeat=%d" % self.iterations, - "--direct=1", "--gtod_reduce=1", "--name=test", + "--direct=1", "--name=test", "--bs=%s" % self.bs, "--iodepth=%s" % self.iodepth, "--size=%sM" % (fio_size_mb or self.fio_size_mb), "--readwrite=%s" % self.op, @@ -662,6 +672,19 @@ class RbdFioTest(RbdTest): s['min'], s['max'], s['mean'], s['median'], s['std_dev'], s['max_90'], s['min_90'], s['sum']]) + + clat_min = array_stats([i["clat_ns_min"] for i in op_data]) + clat_max = array_stats([i["clat_ns_max"] for i in op_data]) + clat_mean = array_stats([i["clat_ns_mean"] for i in op_data]) + clat_stddev = math.sqrt( + sum([float(i["clat_ns_stddev"]) ** 2 for i in op_data]) / len(op_data) + if len(op_data) else 0) + clat_10 = array_stats([i["clat_ns_10"] for i in op_data]) + clat_90 = array_stats([i["clat_ns_90"] for i in op_data]) + table.add_row(["completion latency (ns)", + clat_min['min'], clat_max['max'], clat_mean['mean'], + clat_mean['median'], clat_stddev, + clat_10['mean'], clat_90['mean'], clat_mean['sum']]) print(table) -- 2.39.5