[Fuego] [PATCH] iperf3: use mega bits per second

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Fri Mar 9 06:18:39 UTC 2018


Use Mbps instead of bps because it is easier to read.

Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
---
 engine/tests/Benchmark.iperf3/parser.py      | 11 ++++++-----
 engine/tests/Benchmark.iperf3/reference.json |  6 +++---
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/engine/tests/Benchmark.iperf3/parser.py b/engine/tests/Benchmark.iperf3/parser.py
index a91b88a..197f477 100755
--- a/engine/tests/Benchmark.iperf3/parser.py
+++ b/engine/tests/Benchmark.iperf3/parser.py
@@ -11,22 +11,23 @@ sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
 import common as plib
 
 measurements = {}
+onembps=1000000.0
 with open(plib.TEST_LOG) as f:
     data = json.load(f)
 
     # Measurements to apply criteria
     if 'sum_sent' in data['end']:
         measurements["sum.sent"] = [
-            {"name": "bits_per_second", "measure" : float(data['end']['sum_sent']['bits_per_second'])},
+            {"name": "bits_per_second", "measure" : float(data['end']['sum_sent']['bits_per_second'])/onembps},
             {"name": "retransmits", "measure" : float(data['end']['sum_sent']['retransmits'])}
         ]
     if 'sum_received' in data['end']:
         measurements["sum.received"] = [
-            {"name": "bits_per_second", "measure" : float(data['end']['sum_received']['bits_per_second'])}
+            {"name": "bits_per_second", "measure" : float(data['end']['sum_received']['bits_per_second'])/onembps}
         ]
     if 'sum' in data['end']:
         measurements["sum.udp"] = [
-            {"name": "bits_per_second", "measure" : float(data['end']['sum']['bits_per_second'])},
+            {"name": "bits_per_second", "measure" : float(data['end']['sum']['bits_per_second'])/onembps},
             {"name": "jitter_ms", "measure" : float(data['end']['sum']['jitter_ms'])}
         ]
     measurements["cpu_utilization.host"] = [
@@ -46,12 +47,12 @@ with open(plib.TEST_LOG) as f:
         if interval['sum']['omitted']:
             continue
         time.append(interval['sum']['start'])
-        bits_per_second.append(interval['sum']['bits_per_second'])
+        bits_per_second.append(float(interval['sum']['bits_per_second'])/onembps)
     fig = plt.figure()
     plt.plot(time, bits_per_second)
     plt.title('iperf3 client results')
     plt.xlabel('time (s)')
-    plt.ylabel('Bits per second (bps)')
+    plt.ylabel('Megabits per second (Mbps)')
     fig.savefig(os.environ['LOGDIR'] + '/iperf3.png')
 
 sys.exit(plib.process(measurements))
diff --git a/engine/tests/Benchmark.iperf3/reference.json b/engine/tests/Benchmark.iperf3/reference.json
index f10dc3a..930a94d 100644
--- a/engine/tests/Benchmark.iperf3/reference.json
+++ b/engine/tests/Benchmark.iperf3/reference.json
@@ -8,7 +8,7 @@
                     "measurements":[
                         {
                             "name":"bits_per_second",
-                            "unit":"bps"
+                            "unit":"Mbps"
                         },
                         {
                             "name":"retransmits",
@@ -21,7 +21,7 @@
                     "measurements":[
                         {
                             "name":"bits_per_second",
-                            "unit":"bps"
+                            "unit":"Mbps"
                         }
                     ]
                 },
@@ -30,7 +30,7 @@
                     "measurements":[
                         {
                             "name":"bits_per_second",
-                            "unit":"bps"
+                            "unit":"Mbps"
                         },
                         {
                             "name":"jitter_ms",
-- 
2.7.4




More information about the Fuego mailing list