Report: data
[csit.git] / resources / tools / presentation / generator_tables.py
index af5fcd1..379205c 100644 (file)
@@ -183,12 +183,13 @@ def table_performance_improvements(table, input_data):
                 for build in data[job]:
                     try:
                         data_lst.append(float(build[tmpl_item[0]]["throughput"]
-                                              ["value"]) / 1000000)
+                                              ["value"]))
                     except (KeyError, TypeError):
                         # No data, ignore
                         continue
                 if data_lst:
-                    tbl_item.append({"data": eval(operation)(data_lst)})
+                    tbl_item.append({"data": (eval(operation)(data_lst)) /
+                                             1000000})
                 else:
                     tbl_item.append({"data": None})
             elif cmd == "operation":
@@ -228,19 +229,19 @@ def table_performance_improvements(table, input_data):
             for item in tbl_lst:
                 if "ndr_top" in file_name \
                         and "ndr" in item[1]["data"] \
-                        and item[-1]["data"] >= 10.0:
+                        and round(item[-1]["data"], 1) >= 10.0:
                     _write_line_to_file(file_handler, item)
                 elif "pdr_top" in file_name \
                         and "pdr" in item[1]["data"] \
-                        and item[-1]["data"] >= 10.0:
+                        and round(item[-1]["data"], 1) >= 10.0:
                     _write_line_to_file(file_handler, item)
                 elif "ndr_low" in file_name \
                         and "ndr" in item[1]["data"] \
-                        and item[-1]["data"] < 10.0:
+                        and round(item[-1]["data"], 1) < 10.0:
                     _write_line_to_file(file_handler, item)
                 elif "pdr_low" in file_name \
                         and "pdr" in item[1]["data"] \
-                        and item[-1]["data"] < 10.0:
+                        and round(item[-1]["data"], 1) < 10.0:
                     _write_line_to_file(file_handler, item)
 
     logging.info("  Done.")