diff options
author | Tibor Frank <tifrank@cisco.com> | 2020-03-27 06:41:31 +0100 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2020-03-27 06:41:31 +0100 |
commit | c1801539cbefb0cfff8dc808f467f6456a660d4e (patch) | |
tree | 5ce4cee2dae2e47405b2110e06230d5c002daa7c /resources/tools/presentation/generator_tables.py | |
parent | 01597c5db157d5013d109a93bdaad17b630a9026 (diff) |
Report: Header of comparison tables
Change-Id: Icbfd4f306cbec2840292cb6a350a8e5b09047fa4
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/generator_tables.py')
-rw-r--r-- | resources/tools/presentation/generator_tables.py | 131 |
1 files changed, 64 insertions, 67 deletions
diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py index 4cbc7c0746..30907de357 100644 --- a/resources/tools/presentation/generator_tables.py +++ b/resources/tools/presentation/generator_tables.py @@ -619,27 +619,27 @@ def table_perf_comparison(table, input_data): except (YAMLError, IOError) as err: logging.warning(repr(err)) - if table[u"include-tests"] == u"MRR": - hdr_param = u"Rec Rate" - else: - hdr_param = u"Thput" - history = table.get(u"history", list()) for item in history: header.extend( [ - f"{item[u'title']} {hdr_param} [Mpps]", - f"{item[u'title']} Stdev [Mpps]" + f"{item[u'title']} Avg({table[u'include-tests']})", + f"{item[u'title']} Stdev({table[u'include-tests']})" ] ) header.extend( [ - f"{table[u'reference'][u'title']} {hdr_param} [Mpps]", - f"{table[u'reference'][u'title']} Stdev [Mpps]", - f"{table[u'compare'][u'title']} {hdr_param} [Mpps]", - f"{table[u'compare'][u'title']} Stdev [Mpps]", - u"Delta [%]", - u"Stdev of delta [%]" + f"{table[u'reference'][u'title']} " + f"Avg({table[u'include-tests']})", + f"{table[u'reference'][u'title']} " + f"Stdev({table[u'include-tests']})", + f"{table[u'compare'][u'title']} " + f"Avg({table[u'include-tests']})", + f"{table[u'compare'][u'title']} " + f"Stdev({table[u'include-tests']})", + f"Diff({table[u'reference'][u'title']}," + f"{table[u'compare'][u'title']})", + u"Stdev(Diff)" ] ) header_str = u";".join(header) + u"\n" @@ -809,11 +809,11 @@ def table_perf_comparison(table, input_data): for hist_data in tbl_dict[tst_name][u"history"].values(): if hist_data: if table[u"include-tests"] == u"MRR": - item.append(round(hist_data[0][0] / 1e6, 2)) - item.append(round(hist_data[0][1] / 1e6, 2)) + item.append(round(hist_data[0][0] / 1e6, 1)) + item.append(round(hist_data[0][1] / 1e6, 1)) else: - item.append(round(mean(hist_data) / 1e6, 2)) - item.append(round(stdev(hist_data) / 1e6, 2)) + item.append(round(mean(hist_data) / 1e6, 1)) + item.append(round(stdev(hist_data) / 1e6, 1)) else: item.extend([u"Not tested", u"Not tested"]) else: @@ -826,8 +826,8 @@ def table_perf_comparison(table, input_data): else: data_r_mean = mean(data_r) data_r_stdev = stdev(data_r) - item.append(round(data_r_mean / 1e6, 2)) - item.append(round(data_r_stdev / 1e6, 2)) + item.append(round(data_r_mean / 1e6, 1)) + item.append(round(data_r_stdev / 1e6, 1)) else: data_r_mean = None data_r_stdev = None @@ -840,8 +840,8 @@ def table_perf_comparison(table, input_data): else: data_c_mean = mean(data_c) data_c_stdev = stdev(data_c) - item.append(round(data_c_mean / 1e6, 2)) - item.append(round(data_c_stdev / 1e6, 2)) + item.append(round(data_c_mean / 1e6, 1)) + item.append(round(data_c_stdev / 1e6, 1)) else: data_c_mean = None data_c_stdev = None @@ -924,27 +924,27 @@ def table_perf_comparison_nic(table, input_data): except (YAMLError, IOError) as err: logging.warning(repr(err)) - if table[u"include-tests"] == u"MRR": - hdr_param = u"Rec Rate" - else: - hdr_param = u"Thput" - history = table.get(u"history", list()) for item in history: header.extend( [ - f"{item[u'title']} {hdr_param} [Mpps]", - f"{item[u'title']} Stdev [Mpps]" + f"{item[u'title']} Avg({table[u'include-tests']})", + f"{item[u'title']} Stdev({table[u'include-tests']})" ] ) header.extend( [ - f"{table[u'reference'][u'title']} {hdr_param} [Mpps]", - f"{table[u'reference'][u'title']} Stdev [Mpps]", - f"{table[u'compare'][u'title']} {hdr_param} [Mpps]", - f"{table[u'compare'][u'title']} Stdev [Mpps]", - u"Delta [%]", - u"Stdev of delta [%]" + f"{table[u'reference'][u'title']} " + f"Avg({table[u'include-tests']})", + f"{table[u'reference'][u'title']} " + f"Stdev({table[u'include-tests']})", + f"{table[u'compare'][u'title']} " + f"Avg({table[u'include-tests']})", + f"{table[u'compare'][u'title']} " + f"Stdev({table[u'include-tests']})", + f"Diff({table[u'reference'][u'title']}," + f"{table[u'compare'][u'title']})", + u"Stdev(Diff)" ] ) header_str = u";".join(header) + u"\n" @@ -1120,11 +1120,11 @@ def table_perf_comparison_nic(table, input_data): for hist_data in tbl_dict[tst_name][u"history"].values(): if hist_data: if table[u"include-tests"] == u"MRR": - item.append(round(hist_data[0][0] / 1e6, 2)) - item.append(round(hist_data[0][1] / 1e6, 2)) + item.append(round(hist_data[0][0] / 1e6, 1)) + item.append(round(hist_data[0][1] / 1e6, 1)) else: - item.append(round(mean(hist_data) / 1e6, 2)) - item.append(round(stdev(hist_data) / 1e6, 2)) + item.append(round(mean(hist_data) / 1e6, 1)) + item.append(round(stdev(hist_data) / 1e6, 1)) else: item.extend([u"Not tested", u"Not tested"]) else: @@ -1137,8 +1137,8 @@ def table_perf_comparison_nic(table, input_data): else: data_r_mean = mean(data_r) data_r_stdev = stdev(data_r) - item.append(round(data_r_mean / 1e6, 2)) - item.append(round(data_r_stdev / 1e6, 2)) + item.append(round(data_r_mean / 1e6, 1)) + item.append(round(data_r_stdev / 1e6, 1)) else: data_r_mean = None data_r_stdev = None @@ -1151,8 +1151,8 @@ def table_perf_comparison_nic(table, input_data): else: data_c_mean = mean(data_c) data_c_stdev = stdev(data_c) - item.append(round(data_c_mean / 1e6, 2)) - item.append(round(data_c_stdev / 1e6, 2)) + item.append(round(data_c_mean / 1e6, 1)) + item.append(round(data_c_stdev / 1e6, 1)) else: data_c_mean = None data_c_stdev = None @@ -1223,23 +1223,20 @@ def table_nics_comparison(table, input_data): # Prepare the header of the tables try: - header = [u"Test case", ] - - if table[u"include-tests"] == u"MRR": - hdr_param = u"Rec Rate" - else: - hdr_param = u"Thput" - - header.extend( - [ - f"{table[u'reference'][u'title']} {hdr_param} [Mpps]", - f"{table[u'reference'][u'title']} Stdev [Mpps]", - f"{table[u'compare'][u'title']} {hdr_param} [Mpps]", - f"{table[u'compare'][u'title']} Stdev [Mpps]", - u"Delta [%]", - u"Stdev of delta [%]" - ] - ) + header = [ + u"Test case", + f"{table[u'reference'][u'title']} " + f"Avg({table[u'include-tests']})", + f"{table[u'reference'][u'title']} " + f"Stdev({table[u'include-tests']})", + f"{table[u'compare'][u'title']} " + f"Avg({table[u'include-tests']})", + f"{table[u'compare'][u'title']} " + f"Stdev({table[u'include-tests']})", + f"Diff({table[u'reference'][u'title']}," + f"{table[u'compare'][u'title']})", + u"Stdev(Diff)" + ] except (AttributeError, KeyError) as err: logging.error(f"The model is invalid, missing parameter: {repr(err)}") @@ -1290,8 +1287,8 @@ def table_nics_comparison(table, input_data): else: data_r_mean = mean(data_r) data_r_stdev = stdev(data_r) - item.append(round(data_r_mean / 1e6, 2)) - item.append(round(data_r_stdev / 1e6, 2)) + item.append(round(data_r_mean / 1e6, 1)) + item.append(round(data_r_stdev / 1e6, 1)) else: data_r_mean = None data_r_stdev = None @@ -1304,8 +1301,8 @@ def table_nics_comparison(table, input_data): else: data_c_mean = mean(data_c) data_c_stdev = stdev(data_c) - item.append(round(data_c_mean / 1e6, 2)) - item.append(round(data_c_stdev / 1e6, 2)) + item.append(round(data_c_mean / 1e6, 1)) + item.append(round(data_c_stdev / 1e6, 1)) else: data_c_mean = None data_c_stdev = None @@ -1440,8 +1437,8 @@ def table_soak_vs_ndr(table, input_data): else: data_r_mean = mean(data_r) data_r_stdev = stdev(data_r) - item.append(round(data_r_mean / 1e6, 2)) - item.append(round(data_r_stdev / 1e6, 2)) + item.append(round(data_r_mean / 1e6, 1)) + item.append(round(data_r_stdev / 1e6, 1)) else: data_r_mean = None data_r_stdev = None @@ -1454,8 +1451,8 @@ def table_soak_vs_ndr(table, input_data): else: data_c_mean = mean(data_c) data_c_stdev = stdev(data_c) - item.append(round(data_c_mean / 1e6, 2)) - item.append(round(data_c_stdev / 1e6, 2)) + item.append(round(data_c_mean / 1e6, 1)) + item.append(round(data_c_stdev / 1e6, 1)) else: data_c_mean = None data_c_stdev = None |