2017-04-20 18:38 GMT+02:00 Jan Tluka <jtluka(a)redhat.com>:
Thu, Apr 20, 2017 at 05:21:45PM CEST, jprochaz(a)redhat.com wrote:
>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.
Unfortunately there's a reason behind kbit/s.
Ondrej's patch comment (commit 831b1861f2054d02efd12e5f9d9edee34d57746a):
* The client measures speeds in kilobits by default, previously this
wasn't set so whatever Netperf deemed appropriate was used. This helps
with result parsing.
If you don't specify it netperf would report in units it thinks are
appropriate. I know that you're now parsing the OMNI output that includes
the tput units but that would not work for non-omni tests.
-Jan
Yes, but Ondrej's patch uses -f k, so the rate is measured in kbit/s,
and then it is converted to bits/s in the code.
In my patch, for STREAM tests, -f b is used, so the rate is measured
in bit/s and no further conversion is needed.
And this does work for both omni and non-omni 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
>
> ^^^ beware! tab/space mixing!
>
>>+ if "RR" in self._testname:
>>+ cmd = "netperf -H %s -f x" % self._netperf_server
>>+ # else 10^0bits/s are used as unit
>
> ^^^ beware! tab/space mixing!
>
>>+ 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
>>_______________________________________________
>>LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
>>To unsubscribe send an email to lnst-developers-leave(a)lists.fedorahosted.org