X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_tables.py;h=f4c3e54ce4af8d3f767dab30688139edf884d480;hp=887ee727974475bf77a8370cffc99f84fad930b4;hb=fce7b4b339f7a79b80143bbd796460720489d694;hpb=1469b71f48bb4e397ebaa65fbaf0512be691ec49 diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py index 887ee72797..f4c3e54ce4 100644 --- a/resources/tools/presentation/generator_tables.py +++ b/resources/tools/presentation/generator_tables.py @@ -608,21 +608,24 @@ def table_soak_vs_ndr(table, input_data): tbl_lst = list() for tst_name in tbl_dict.keys(): item = [tbl_dict[tst_name]["name"], ] - data_t = tbl_dict[tst_name]["ref-data"] - if data_t: - item.append(round(mean(data_t) / 1000000, 2)) - item.append(round(stdev(data_t) / 1000000, 2)) + data_r = tbl_dict[tst_name]["ref-data"] + if data_r: + data_r_mean = mean(data_r) + item.append(round(data_r_mean / 1000000, 2)) + item.append(round(stdev(data_r) / 1000000, 2)) else: + data_r_mean = None item.extend([None, None]) - data_t = tbl_dict[tst_name]["cmp-data"] - if data_t: - item.append(round(mean(data_t) / 1000000, 2)) - item.append(round(stdev(data_t) / 1000000, 2)) + data_c = tbl_dict[tst_name]["cmp-data"] + if data_c: + data_c_mean = mean(data_c) + item.append(round(data_c_mean / 1000000, 2)) + item.append(round(stdev(data_c) / 1000000, 2)) else: + data_c_mean = None item.extend([None, None]) - if 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): + if data_r_mean and data_c_mean is not None: + item.append(round(relative_change(data_r_mean, data_c_mean), 2)) tbl_lst.append(item) # Sort the table according to the relative change