We used kbit/s as output rate for STREAM tests, then we converted it to
bit/s. This patch changes that so the output rate is in bit/s for STREAM
tests and Trans/s for RR tests.
It also adds THROUGHPUT_UNITS omni output selector for omni tests and
adds support for parsing units - both bps and tps
Signed-off-by: Jiri Prochazka <jprochaz(a)redhat.com>
---
test_modules/Netperf.py | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/test_modules/Netperf.py b/test_modules/Netperf.py
index 5a0e989..fbc4885 100644
--- a/test_modules/Netperf.py
+++ b/test_modules/Netperf.py
@@ -68,7 +68,12 @@ class Netperf(TestGeneric):
composes commands for netperf and netserver based on xml recipe
"""
if self._role == "client":
- cmd = "netperf -H %s -f k" % self._netperf_server
+ # for request response test transactions per seconds are used as unit
+ if "RR" in self._testname:
+ cmd = "netperf -H %s -f x" % self._netperf_server
+ # else 10^0bits/s are used as unit
+ else:
+ cmd = "netperf -H %s -f b" % self._netperf_server
if self._is_omni():
# -P 0 disables banner header of output
cmd += " -P 0"
@@ -134,7 +139,8 @@ class Netperf(TestGeneric):
# Print only relevant output
if self._is_omni():
- cmd += ' -- -k "THROUGHPUT, LOCAL_CPU_UTIL, REMOTE_CPU_UTIL,
'\
+ cmd += ' -- -k "THROUGHPUT, THROUGHPUT_UNITS, '\
+ 'LOCAL_CPU_UTIL, REMOTE_CPU_UTIL, '\
'CONFIDENCE_LEVEL, THROUGHPUT_CONFID, LOCAL_SEND_SIZE, '\
'REMOTE_RECV_SIZE, LOCAL_SEND_THROUGHPUT, '\
'REMOTE_RECV_THROUGHPUT, LOCAL_CPU_PEAK_UTIL, '\
@@ -195,13 +201,20 @@ class Netperf(TestGeneric):
pattern_throughput = "THROUGHPUT=(\d+\.\d+)"
throughput = re.search(pattern_throughput, output)
+ pattern_throughput_units = "THROUGHPUT_UNITS=(.*)"
+ throughput_units = re.search(pattern_throughput_units, output).group(1)
+
if throughput is None:
- rate_in_kb = 0.0
+ rate = 0.0
else:
- rate_in_kb = float(throughput.group(1))
+ rate = float(throughput.group(1))
- res_val["rate"] = rate_in_kb*1000
- res_val["unit"] = "bps"
+ if throughput_units == "10^0bits/s":
+ res_val["unit"] = "bps"
+ elif throughput_units == "Trans/s":
+ res_val["unit"] = "tps"
+
+ res_val["rate"] = rate
if self._cpu_util is not None:
if self._cpu_util == "local" or self._cpu_util ==
"both":
--
2.9.3