X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_tables.py;h=a5a573ad9427ea7bd4644dcb171ae9e2e7a8a9ec;hp=59162444dcfd33664e8374f930fa0b111a46662b;hb=6f8266f81bb052e2c0e51b029e47f0eb4f04a7ed;hpb=7aff808942440ba9729bf60888738b920c024324 diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py index 59162444dc..a5a573ad94 100644 --- a/resources/tools/presentation/generator_tables.py +++ b/resources/tools/presentation/generator_tables.py @@ -407,16 +407,22 @@ def table_performance_comparison(table, input_data): data_t = remove_outliers(tbl_dict[tst_name]["ref-data"], outlier_const=table["outlier-const"]) # TODO: Specify window size. - item.append(round(mean(data_t) / 1000000, 2)) - item.append(round(stdev(data_t) / 1000000, 2)) + if data_t: + item.append(round(mean(data_t) / 1000000, 2)) + item.append(round(stdev(data_t) / 1000000, 2)) + else: + item.extend([None, None]) else: item.extend([None, None]) if tbl_dict[tst_name]["cmp-data"]: data_t = remove_outliers(tbl_dict[tst_name]["cmp-data"], outlier_const=table["outlier-const"]) # TODO: Specify window size. - item.append(round(mean(data_t) / 1000000, 2)) - item.append(round(stdev(data_t) / 1000000, 2)) + if data_t: + item.append(round(mean(data_t) / 1000000, 2)) + item.append(round(stdev(data_t) / 1000000, 2)) + else: + item.extend([None, None]) else: item.extend([None, None]) if item[1] is not None and item[3] is not None: @@ -598,16 +604,22 @@ def table_performance_comparison_mrr(table, input_data): data_t = remove_outliers(tbl_dict[tst_name]["ref-data"], outlier_const=table["outlier-const"]) # TODO: Specify window size. - item.append(round(mean(data_t) / 1000000, 2)) - item.append(round(stdev(data_t) / 1000000, 2)) + if data_t: + item.append(round(mean(data_t) / 1000000, 2)) + item.append(round(stdev(data_t) / 1000000, 2)) + else: + item.extend([None, None]) else: item.extend([None, None]) if tbl_dict[tst_name]["cmp-data"]: data_t = remove_outliers(tbl_dict[tst_name]["cmp-data"], outlier_const=table["outlier-const"]) # TODO: Specify window size. - item.append(round(mean(data_t) / 1000000, 2)) - item.append(round(stdev(data_t) / 1000000, 2)) + if data_t: + item.append(round(mean(data_t) / 1000000, 2)) + item.append(round(stdev(data_t) / 1000000, 2)) + else: + item.extend([None, None]) else: item.extend([None, None]) if item[1] is not None and item[3] is not None and item[1] != 0: @@ -786,12 +798,15 @@ def table_performance_trending_dashboard(table, input_data): else classification for idx in range(first_idx, len(classification_lst)): if classification_lst[idx] == tmp_classification: - index = idx - break + if rel_change_lst[idx]: + index = idx + break for idx in range(index+1, len(classification_lst)): if classification_lst[idx] == tmp_classification: - if rel_change_lst[idx] > rel_change_lst[index]: - index = idx + if rel_change_lst[idx]: + if (abs(rel_change_lst[idx]) > + abs(rel_change_lst[index])): + index = idx trend = round(float(median_lst[-1]) / 1000000, 2) \ if not isnan(median_lst[-1]) else '-'