X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_tables.py;h=5efe66777b74d72df2c4cfcb96246495da60f63e;hp=f04495c4a1dd18741527da8fbd0baa812f158c5b;hb=83e5550cfe67ba193c3ae9052258c111dbe342e4;hpb=73c71f744a239090d8de45f7f8a72bcda0a7eed0 diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py index f04495c4a1..5efe66777b 100644 --- a/resources/tools/presentation/generator_tables.py +++ b/resources/tools/presentation/generator_tables.py @@ -296,6 +296,20 @@ def table_performance_comparison(table, input_data): replace("4t4c", "4c").replace("8t4c", "4c") if "across topologies" in table["title"].lower(): tst_name_mod = tst_name_mod.replace("2n1l-", "") + if tbl_dict.get(tst_name_mod, None) is None: + groups = re.search(REGEX_NIC, tst_data["parent"]) + nic = groups.group(0) if groups else "" + name = "{0}-{1}".format(nic, "-".join(tst_data["name"]. + split("-")[:-1])) + if "across testbeds" in table["title"].lower() or \ + "across topologies" in table["title"].lower(): + name = name.\ + replace("1t1c", "1c").replace("2t1c", "1c").\ + replace("2t2c", "2c").replace("4t2c", "2c").\ + replace("4t4c", "4c").replace("8t4c", "4c") + tbl_dict[tst_name_mod] = {"name": name, + "ref-data": list(), + "cmp-data": list()} try: # TODO: Re-work when NDRPDRDISC tests are not used if table["include-tests"] == "MRR": @@ -317,10 +331,8 @@ def table_performance_comparison(table, input_data): tst_data["throughput"]["NDR"]["LOWER"]) else: continue - except KeyError: + except (KeyError, TypeError): pass - except TypeError: - tbl_dict.pop(tst_name_mod, None) if history: for item in history: for job, builds in item["data"].items(): @@ -397,9 +409,13 @@ def table_performance_comparison(table, input_data): item.append(round(stdev(data_t) / 1000000, 2)) else: item.extend([None, None]) - if item[-4] is not None and item[-2] is not None and item[-4] != 0: + if "dot1q" in tbl_dict[tst_name]["name"]: + item.append("Changed methodology") + elif item[-4] is not None and item[-2] is not None and item[-4] != 0: item.append(int(relative_change(float(item[-4]), float(item[-2])))) - if len(item) == len(header): + else: + item.append("n/a") + if (len(item) == len(header)) and (item[-3] is not None): tbl_lst.append(item) # Sort the table according to the relative change @@ -528,6 +544,18 @@ def table_performance_comparison_nic(table, input_data): tst_name_mod = re.sub(REGEX_NIC, "", tst_name_mod) if "across topologies" in table["title"].lower(): tst_name_mod = tst_name_mod.replace("2n1l-", "") + if tbl_dict.get(tst_name_mod, None) is None: + name = "{0}".format("-".join(tst_data["name"]. + split("-")[:-1])) + if "across testbeds" in table["title"].lower() or \ + "across topologies" in table["title"].lower(): + name = name.\ + replace("1t1c", "1c").replace("2t1c", "1c").\ + replace("2t2c", "2c").replace("4t2c", "2c").\ + replace("4t4c", "4c").replace("8t4c", "4c") + tbl_dict[tst_name_mod] = {"name": name, + "ref-data": list(), + "cmp-data": list()} try: # TODO: Re-work when NDRPDRDISC tests are not used if table["include-tests"] == "MRR": @@ -549,10 +577,9 @@ def table_performance_comparison_nic(table, input_data): tst_data["throughput"]["NDR"]["LOWER"]) else: continue - except KeyError: + except (KeyError, TypeError): pass - except TypeError: - tbl_dict.pop(tst_name_mod, None) + if history: for item in history: for job, builds in item["data"].items(): @@ -632,9 +659,13 @@ def table_performance_comparison_nic(table, input_data): item.append(round(stdev(data_t) / 1000000, 2)) else: item.extend([None, None]) - if item[-4] is not None and item[-2] is not None and item[-4] != 0: + if "dot1q" in tbl_dict[tst_name]["name"]: + item.append("Changed methodology") + elif item[-4] is not None and item[-2] is not None and item[-4] != 0: item.append(int(relative_change(float(item[-4]), float(item[-2])))) - if len(item) == len(header): + else: + item.append("n/a") + if (len(item) == len(header)) and (item[-3] is not None): tbl_lst.append(item) # Sort the table according to the relative change