diff options
author | 2022-05-19 14:24:15 +0200 | |
---|---|---|
committer | 2022-06-09 11:00:10 +0000 | |
commit | a6c94c7c5898fb8570f6f9ca6fdc1909d43c5dc0 (patch) | |
tree | 934f6cda980c0b7ac105092f0db00e88a992e780 /resources/tools/dash/app/pal/report/layout.py | |
parent | 400205b1f838b88e72236559308d9c4b3ee61aa4 (diff) |
feat(uti): Add statistical graphs
Change-Id: Ia2831cfbcb9e2333c5b49af5c6b0577867d99902
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/dash/app/pal/report/layout.py')
-rw-r--r-- | resources/tools/dash/app/pal/report/layout.py | 74 |
1 files changed, 39 insertions, 35 deletions
diff --git a/resources/tools/dash/app/pal/report/layout.py b/resources/tools/dash/app/pal/report/layout.py index 26b9a9f4b5..ef98b7b376 100644 --- a/resources/tools/dash/app/pal/report/layout.py +++ b/resources/tools/dash/app/pal/report/layout.py @@ -33,7 +33,7 @@ from pprint import pformat from ..data.data import Data from ..data.url_processing import url_decode, url_encode -from .graphs import graph_iterative, table_comparison +from .graphs import graph_iterative, table_comparison, get_short_version class Layout: @@ -116,9 +116,9 @@ class Layout: for _, row in self._data[cols].drop_duplicates().iterrows(): rls = row["release"] ttype = row["test_type"] - d_ver = row["dut_version"] lst_job = row["job"].split("-") dut = lst_job[1] + d_ver = get_short_version(row["dut_version"], dut) tbed = "-".join(lst_job[-2:]) lst_test_id = row["test_id"].split(".") if dut == "dpdk": @@ -131,10 +131,7 @@ class Layout: nic = suite.split("-")[0] for drv in self.DRIVERS: if drv in test: - if drv == "af-xdp": - driver = "af_xdp" - else: - driver = drv + driver = drv.replace("-", "_") test = test.replace(f"{drv}-", "") break else: @@ -157,20 +154,27 @@ class Layout: tbs[rls][dut][d_ver][infra][area] = dict() if tbs[rls][dut][d_ver][infra][area].get(test, None) is None: tbs[rls][dut][d_ver][infra][area][test] = dict() - tbs_test = tbs[rls][dut][d_ver][infra][area][test] - tbs_test["core"] = list() - tbs_test["frame-size"] = list() - tbs_test["test-type"] = list() - if core.upper() not in tbs_test["core"]: - tbs_test["core"].append(core.upper()) - if framesize.upper() not in tbs_test["frame-size"]: - tbs_test["frame-size"].append(framesize.upper()) + tbs[rls][dut][d_ver][infra][area][test]["core"] = list() + tbs[rls][dut][d_ver][infra][area][test]["frame-size"] = list() + tbs[rls][dut][d_ver][infra][area][test]["test-type"] = list() + if core.upper() not in \ + tbs[rls][dut][d_ver][infra][area][test]["core"]: + tbs[rls][dut][d_ver][infra][area][test]["core"].append( + core.upper()) + if framesize.upper() not in \ + tbs[rls][dut][d_ver][infra][area][test]["frame-size"]: + tbs[rls][dut][d_ver][infra][area][test]["frame-size"].append( + framesize.upper()) if ttype == "mrr": - if "MRR" not in tbs_test["test-type"]: - tbs_test["test-type"].append("MRR") + if "MRR" not in \ + tbs[rls][dut][d_ver][infra][area][test]["test-type"]: + tbs[rls][dut][d_ver][infra][area][test]["test-type"].append( + "MRR") elif ttype == "ndrpdr": - if "NDR" not in tbs_test["test-type"]: - tbs_test["test-type"].extend(("NDR", "PDR", )) + if "NDR" not in \ + tbs[rls][dut][d_ver][infra][area][test]["test-type"]: + tbs[rls][dut][d_ver][infra][area][test]["test-type"].extend( + ("NDR", "PDR", )) self._spec_tbs = tbs # Read from files: @@ -366,8 +370,8 @@ class Layout: width=6 ), dbc.Col( - dbc.Row( # TSA - id="row-graph-tsa", + dbc.Row( # Latency + id="row-graph-lat", class_name="g-0 p-2", children=[ self.PLACEHOLDER @@ -787,10 +791,10 @@ class Layout: """ """ - (fig_tput, fig_tsa) = figs + (fig_tput, fig_lat) = figs row_fig_tput = self.PLACEHOLDER - row_fig_tsa = self.PLACEHOLDER + row_fig_lat = self.PLACEHOLDER row_table = self.PLACEHOLDER row_btn_dwnld = self.PLACEHOLDER @@ -840,11 +844,11 @@ class Layout: ] ) ] - if fig_tsa: - row_fig_tsa = [ + if fig_lat: + row_fig_lat = [ dcc.Graph( id={"type": "graph", "index": "lat"}, - figure=fig_tsa + figure=fig_lat ) ] if not table.empty: @@ -858,13 +862,13 @@ class Layout: ) ] - return row_fig_tput, row_fig_tsa, row_table, row_btn_dwnld + return row_fig_tput, row_fig_lat, row_table, row_btn_dwnld @app.callback( Output("control-panel", "data"), # Store Output("selected-tests", "data"), # Store Output("row-graph-tput", "children"), - Output("row-graph-tsa", "children"), + Output("row-graph-lat", "children"), Output("row-table", "children"), Output("row-btn-download", "children"), Output("row-card-sel-tests", "style"), @@ -950,7 +954,7 @@ class Layout: parsed_url = url_decode(href) row_fig_tput = no_update - row_fig_tsa = no_update + row_fig_lat = no_update row_table = no_update row_btn_dwnld = no_update row_card_sel_tests = no_update @@ -1282,7 +1286,7 @@ class Layout: ctrl_panel.set({ "cl-selected-options": self._list_tests(store_sel) }) - row_fig_tput, row_fig_tsa, row_table, row_btn_dwnld = \ + row_fig_tput, row_fig_lat, row_table, row_btn_dwnld = \ _generate_plotting_area( graph_iterative(self.data, store_sel, self.layout), table_comparison(self.data, store_sel), @@ -1291,7 +1295,7 @@ class Layout: elif trigger_id == "btn-sel-remove-all": _ = btn_remove_all row_fig_tput = self.PLACEHOLDER - row_fig_tsa = self.PLACEHOLDER + row_fig_lat = self.PLACEHOLDER row_table = self.PLACEHOLDER row_btn_dwnld = self.PLACEHOLDER row_card_sel_tests = self.STYLE_DISABLED @@ -1307,7 +1311,7 @@ class Layout: new_store_sel.append(item) store_sel = new_store_sel if store_sel: - row_fig_tput, row_fig_tsa, row_table, row_btn_dwnld = \ + row_fig_tput, row_fig_lat, row_table, row_btn_dwnld = \ _generate_plotting_area( graph_iterative(self.data, store_sel, self.layout), table_comparison(self.data, store_sel), @@ -1318,7 +1322,7 @@ class Layout: }) else: row_fig_tput = self.PLACEHOLDER - row_fig_tsa = self.PLACEHOLDER + row_fig_lat = self.PLACEHOLDER row_table = self.PLACEHOLDER row_btn_dwnld = self.PLACEHOLDER row_card_sel_tests = self.STYLE_DISABLED @@ -1332,7 +1336,7 @@ class Layout: store_sel = literal_eval( url_params.get("store_sel", list())[0]) if store_sel: - row_fig_tput, row_fig_tsa, row_table, row_btn_dwnld = \ + row_fig_tput, row_fig_lat, row_table, row_btn_dwnld = \ _generate_plotting_area( graph_iterative(self.data, store_sel, self.layout), @@ -1346,7 +1350,7 @@ class Layout: }) else: row_fig_tput = self.PLACEHOLDER - row_fig_tsa = self.PLACEHOLDER + row_fig_lat = self.PLACEHOLDER row_table = self.PLACEHOLDER row_btn_dwnld = self.PLACEHOLDER row_card_sel_tests = self.STYLE_DISABLED @@ -1364,7 +1368,7 @@ class Layout: ret_val = [ ctrl_panel.panel, store_sel, - row_fig_tput, row_fig_tsa, row_table, row_btn_dwnld, + row_fig_tput, row_fig_lat, row_table, row_btn_dwnld, row_card_sel_tests, row_btns_sel_tests ] ret_val.extend(ctrl_panel.values()) |