FIX: integer divisions 73/23873/3
authorJan Gelety <jgelety@cisco.com>
Sat, 30 Nov 2019 05:47:45 +0000 (06:47 +0100)
committerPeter Mikus <pmikus@cisco.com>
Mon, 9 Dec 2019 14:44:43 +0000 (14:44 +0000)
Change-Id: I28caf62f418bf18601cd379603d03c307e3ba9c8
Signed-off-by: Jan Gelety <jgelety@cisco.com>
resources/libraries/python/DUTSetup.py
resources/tools/integrated/compare_perpatch.py

index 3544997..1a8899f 100644 (file)
@@ -826,7 +826,7 @@ class DUTSetup:
             # If we want to allocate hugepage dynamically
             if allocate:
                 mem_needed = (mem_size * 1024) - (huge_free * huge_size)
-                huge_to_allocate = ((mem_needed / huge_size) * 2) + huge_total
+                huge_to_allocate = ((mem_needed // huge_size) * 2) + huge_total
                 max_map_count = huge_to_allocate*4
                 # Increase maximum number of memory map areas a process may have
                 ret_code, _, _ = ssh.exec_command_sudo(
index dd15490..72ae575 100644 (file)
@@ -39,7 +39,7 @@ def hack(value_list):
     :rtype: list of float
     """
     tmp = sorted(value_list)
-    eight = len(tmp) / 8
+    eight = len(tmp) // 8
     ret = tmp[3*eight:-eight]
     return tmp # ret
 
@@ -100,7 +100,7 @@ for test_index in range(num_tests):
         [current_stats])
     print(f"Value-ordered MRR values for parent build: {parent_values}")
     print(f"Value-ordered MRR values for current build: {current_values}")
-    avg_diff = (current_stats.avg - parent_stats.avg) / parent_stats.avg
+    avg_diff = (current_stats.avg - parent_stats.avg) // parent_stats.avg
     print(f"Difference of averages relative to parent: {100 * avg_diff}%")
     print(f"Jumpavg representation of parent group: {parent_stats}")
     print(f"Jumpavg representation of current group: {current_stats}")

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.