Xena: Modify the throughput result typecasts int issue 33/16233/1
authortli <tli@redhat.com>
Fri, 1 Jul 2016 02:48:52 +0000 (22:48 -0400)
committertli <tli@redhat.com>
Fri, 1 Jul 2016 02:48:52 +0000 (22:48 -0400)
Modify the _create_throughput_result method typecasts int to
typecasts to float

JIRA: VSPERF-312

Change-Id: I45722251f3ca200373aa7b6958e62ea511c304f8
Signed-off-by: tli <tli@redhat.com>
tools/pkt_gen/xena/xena.py

index e76ebcb..7dd4b90 100755 (executable)
@@ -92,11 +92,11 @@ class Xena(ITrafficGenerator):
 
         if test_type == 'Throughput':
             results = OrderedDict()
-            results[ResultsConstants.THROUGHPUT_RX_FPS] = int(
-                root[0][1][0][0].get('PortRxPps')) + int(
+            results[ResultsConstants.THROUGHPUT_RX_FPS] = float(
+                root[0][1][0][0].get('PortRxPps')) + float(
                     root[0][1][0][1].get('PortRxPps'))
-            results[ResultsConstants.THROUGHPUT_RX_MBPS] = (int(
-                root[0][1][0][0].get('PortRxBpsL1')) + int(
+            results[ResultsConstants.THROUGHPUT_RX_MBPS] = (float(
+                root[0][1][0][0].get('PortRxBpsL1')) + float(
                     root[0][1][0][1].get('PortRxBpsL1')))/ 1000000
             results[ResultsConstants.THROUGHPUT_RX_PERCENT] = (
                 100 - int(root[0][1][0].get('TotalLossRatioPcnt'))) * float(