Report: Use rounded values
[csit.git] / resources / tools / report_gen / run_improvments_tables.py
index 0432644..6b4953c 100755 (executable)
@@ -116,7 +116,7 @@ def write_line_to_file(file_handler, item):
 
     mean = "" if item["mean"] is None else "{:.1f}".format(item["mean"])
     stdev = "" if item["stdev"] is None else "{:.1f}".format(item["stdev"])
 
     mean = "" if item["mean"] is None else "{:.1f}".format(item["mean"])
     stdev = "" if item["stdev"] is None else "{:.1f}".format(item["stdev"])
-    change = "" if item["change"] is None else "{:.1f}%".format(item["change"])
+    change = "" if item["change"] is None else "{:.0f}%".format(item["change"])
     file_handler.write("{},{},{},{}\n".format(item["old"], mean, stdev, change))
 
 
     file_handler.write("{},{},{},{}\n".format(item["old"], mean, stdev, change))
 
 
@@ -175,7 +175,8 @@ def main():
             mean = float(mean) / 1000000
             old = float(item["last_old"])
             item["mean"] = mean
             mean = float(mean) / 1000000
             old = float(item["last_old"])
             item["mean"] = mean
-            item["change"] = ((mean - old) / old) * 100
+            item["change"] = ((round(mean, 1) - round(old, 1)) / round(old, 1))\
+                             * 100
             item["stdev"] = stdev / 1000000
 
     # Sort the list, key = change
             item["stdev"] = stdev / 1000000
 
     # Sort the list, key = change

©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.