X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_tables.py;h=2e7d3dee363cd2126a463d277e14ce99ca7530be;hp=1e1307b5bccba22aea4605f12c1b0e423b15d7ee;hb=18f2763797ff782f9068550fc2f01cad4d7056af;hpb=6353e5b063a146fe4bd66437ef09f540b9f87514 diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py index 1e1307b5bc..2e7d3dee36 100644 --- a/resources/tools/presentation/generator_tables.py +++ b/resources/tools/presentation/generator_tables.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2022 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -297,28 +297,15 @@ def table_oper_data_html(table, input_data): threads = dict({idx: list() for idx in range(len(runtime))}) for idx, run_data in runtime.items(): for gnode, gdata in run_data.items(): - if gdata[u"vectors"] > 0: - clocks = gdata[u"clocks"] / gdata[u"vectors"] - elif gdata[u"calls"] > 0: - clocks = gdata[u"clocks"] / gdata[u"calls"] - elif gdata[u"suspends"] > 0: - clocks = gdata[u"clocks"] / gdata[u"suspends"] - else: - clocks = 0.0 - if gdata[u"calls"] > 0: - vectors_call = gdata[u"vectors"] / gdata[u"calls"] - else: - vectors_call = 0.0 - if int(gdata[u"calls"]) + int(gdata[u"vectors"]) + \ - int(gdata[u"suspends"]): - threads[idx].append([ - gnode, - int(gdata[u"calls"]), - int(gdata[u"vectors"]), - int(gdata[u"suspends"]), - clocks, - vectors_call - ]) + threads[idx].append([ + gnode, + int(gdata[u"calls"]), + int(gdata[u"vectors"]), + int(gdata[u"suspends"]), + float(gdata[u"clocks"]), + float(gdata[u"vectors"] / gdata[u"calls"]) \ + if gdata[u"calls"] else 0.0 + ]) bold = ET.SubElement(tcol, u"b") bold.text = ( @@ -972,7 +959,7 @@ def table_perf_trending_dash(table, input_data): header = [ u"Test Case", u"Trend [Mpps]", - u"Short-Term Change [%]", + u"Runs [#]", u"Long-Term Change [%]", u"Regressions [#]", u"Progressions [#]" @@ -1034,6 +1021,13 @@ def table_perf_trending_dash(table, input_data): last_avg = avgs[-1] avg_week_ago = avgs[max(-win_size, -len(avgs))] + nr_of_last_avgs = 0; + for x in reversed(avgs): + if x == last_avg: + nr_of_last_avgs += 1 + else: + break + if isnan(last_avg) or isnan(avg_week_ago) or avg_week_ago == 0.0: rel_change_last = nan else: @@ -1055,28 +1049,23 @@ def table_perf_trending_dash(table, input_data): tbl_lst.append( [tbl_dict[tst_name][u"name"], round(last_avg / 1e6, 2), - rel_change_last, + nr_of_last_avgs, rel_change_long, classification_lst[-win_size+1:].count(u"regression"), classification_lst[-win_size+1:].count(u"progression")]) tbl_lst.sort(key=lambda rel: rel[0]) - tbl_lst.sort(key=lambda rel: rel[3]) tbl_lst.sort(key=lambda rel: rel[2]) - - tbl_sorted = list() - for nrr in range(table[u"window"], -1, -1): - tbl_reg = [item for item in tbl_lst if item[4] == nrr] - for nrp in range(table[u"window"], -1, -1): - tbl_out = [item for item in tbl_reg if item[5] == nrp] - tbl_sorted.extend(tbl_out) + tbl_lst.sort(key=lambda rel: rel[3]) + tbl_lst.sort(key=lambda rel: rel[5], reverse=True) + tbl_lst.sort(key=lambda rel: rel[4], reverse=True) file_name = f"{table[u'output-file']}{table[u'output-file-ext']}" logging.info(f" Writing file: {file_name}") with open(file_name, u"wt") as file_handler: file_handler.write(header_str) - for test in tbl_sorted: + for test in tbl_lst: file_handler.write(u",".join([str(item) for item in test]) + u'\n') logging.info(f" Writing file: {table[u'output-file']}.txt") @@ -1111,6 +1100,8 @@ def _generate_url(testbed, test_name): nic = u"x553" elif u"cx556" in test_name or u"cx556a" in test_name: nic = u"cx556a" + elif u"ena" in test_name: + nic = u"nitro50g" else: nic = u"" @@ -1143,15 +1134,18 @@ def _generate_url(testbed, test_name): cores = u"4t4c" elif u"2t1c" in test_name or \ (u"-1c-" in test_name and - testbed in (u"2n-skx", u"3n-skx", u"2n-clx", u"2n-zn2")): + testbed in + (u"2n-skx", u"3n-skx", u"2n-clx", u"2n-zn2", u"2n-aws", u"3n-aws")): cores = u"2t1c" elif u"4t2c" in test_name or \ (u"-2c-" in test_name and - testbed in (u"2n-skx", u"3n-skx", u"2n-clx", u"2n-zn2")): + testbed in + (u"2n-skx", u"3n-skx", u"2n-clx", u"2n-zn2", u"2n-aws", u"3n-aws")): cores = u"4t2c" elif u"8t4c" in test_name or \ (u"-4c-" in test_name and - testbed in (u"2n-skx", u"3n-skx", u"2n-clx", u"2n-zn2")): + testbed in + (u"2n-skx", u"3n-skx", u"2n-clx", u"2n-zn2", u"2n-aws", u"3n-aws")): cores = u"8t4c" else: cores = u"" @@ -1162,10 +1156,14 @@ def _generate_url(testbed, test_name): driver = u"l3fwd" elif u"avf" in test_name: driver = u"avf" + elif u"af-xdp" in test_name or u"af_xdp" in test_name: + driver = u"af_xdp" elif u"rdma" in test_name: driver = u"rdma" elif u"dnv" in testbed or u"tsh" in testbed: driver = u"ixgbe" + elif u"ena" in test_name: + driver = u"ena" else: driver = u"dpdk" @@ -1270,6 +1268,8 @@ def _generate_url(testbed, test_name): bsf += u"-sw" elif u"hw" in test_name: bsf += u"-hw" + elif u"spe" in test_name: + bsf += u"-spe" elif u"ethip4vxlan" in test_name: domain = u"ip4_tunnels" elif u"ethip4udpgeneve" in test_name: @@ -1997,14 +1997,14 @@ def table_comparison(table, input_data): else: if idx < len(cols): new_itm = ( - f"{round(float(itm[u'mean']) / 1e6, 1)} " - f"\u00B1{round(float(itm[u'stdev']) / 1e6, 1)}". + f"{round(float(itm[u'mean']) / 1e6, 2)} " + f"\u00B1{round(float(itm[u'stdev']) / 1e6, 2)}". replace(u"nan", u"NaN") ) else: new_itm = ( - f"{round(float(itm[u'mean']) / 1e6, 1):+} " - f"\u00B1{round(float(itm[u'stdev']) / 1e6, 1)}". + f"{round(float(itm[u'mean']) / 1e6, 2):+} " + f"\u00B1{round(float(itm[u'stdev']) / 1e6, 2)}". replace(u"nan", u"NaN") ) if len(new_itm.rsplit(u" ", 1)[-1]) > max_lens[idx]: