X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=csit.infra.dash%2Fapp%2Fcdash%2Freport%2Flayout.py;h=cae6993ec2af71bd6a6785adc186e91cd5ccb58f;hb=a214378b5d0589fcbd9a9cc8c9b25bce8a862cec;hp=9e293120efbb53b3fb0d28dcbb9c40cabcfa2ae0;hpb=c9406116477c30590e002809993a9d692b78d25c;p=csit.git diff --git a/csit.infra.dash/app/cdash/report/layout.py b/csit.infra.dash/app/cdash/report/layout.py index 9e293120ef..cae6993ec2 100644 --- a/csit.infra.dash/app/cdash/report/layout.py +++ b/csit.infra.dash/app/cdash/report/layout.py @@ -33,7 +33,6 @@ from ..utils.trigger import Trigger from ..utils.utils import show_tooltip, label, sync_checklists, gen_new_url, \ generate_options, get_list_group_items from ..utils.url_processing import url_decode -from ..data.data import Data from .graphs import graph_iterative, select_iterative_data @@ -76,8 +75,14 @@ class Layout: """The layout of the dash app and the callbacks. """ - def __init__(self, app: Flask, releases: list, html_layout_file: str, - graph_layout_file: str, data_spec_file: str, tooltip_file: str) -> None: + def __init__( + self, + app: Flask, + data_iterative: pd.DataFrame, + html_layout_file: str, + graph_layout_file: str, + tooltip_file: str + ) -> None: """Initialization: - save the input parameters, - read and pre-process the data, @@ -86,51 +91,32 @@ class Layout: - read tooltips from the tooltip file. :param app: Flask application running the dash application. - :param releases: Lis of releases to be displayed. :param html_layout_file: Path and name of the file specifying the HTML layout of the dash application. :param graph_layout_file: Path and name of the file with layout of plot.ly graphs. - :param data_spec_file: Path and name of the file specifying the data to - be read from parquets for this application. :param tooltip_file: Path and name of the yaml file specifying the tooltips. :type app: Flask - :type releases: list :type html_layout_file: str :type graph_layout_file: str - :type data_spec_file: str :type tooltip_file: str """ # Inputs self._app = app - self.releases = releases self._html_layout_file = html_layout_file self._graph_layout_file = graph_layout_file - self._data_spec_file = data_spec_file self._tooltip_file = tooltip_file - - # Read the data: - self._data = pd.DataFrame() - for rls in releases: - data_mrr = Data(self._data_spec_file, True).\ - read_iterative_mrr(release=rls) - data_mrr["release"] = rls - data_ndrpdr = Data(self._data_spec_file, True).\ - read_iterative_ndrpdr(release=rls) - data_ndrpdr["release"] = rls - self._data = pd.concat( - [self._data, data_mrr, data_ndrpdr], - ignore_index=True - ) + self._data = data_iterative # Get structure of tests: tbs = dict() - cols = ["job", "test_id", "test_type", "dut_version", "release"] + cols = [ + "job", "test_id", "test_type", "dut_version", "tg_type", "release" + ] for _, row in self._data[cols].drop_duplicates().iterrows(): rls = row["release"] - ttype = row["test_type"] lst_job = row["job"].split("-") dut = lst_job[1] d_ver = row["dut_version"] @@ -182,18 +168,31 @@ class Layout: tbs[rls][dut][d_ver][infra][area][test]["frame-size"].append( framesize.upper() ) - if ttype == "mrr": + if row["test_type"] == "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": + elif row["test_type"] == "ndrpdr": 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", ) ) + elif row["test_type"] == "hoststack" and \ + row["tg_type"] in ("iperf", "vpp"): + if "BPS" not in \ + tbs[rls][dut][d_ver][infra][area][test]["test-type"]: + tbs[rls][dut][d_ver][infra][area][test]["test-type"].append( + "BPS" + ) + elif row["test_type"] == "hoststack" and row["tg_type"] == "ab": + if "CPS" not in \ + tbs[rls][dut][d_ver][infra][area][test]["test-type"]: + tbs[rls][dut][d_ver][infra][area][test]["test-type"].extend( + ("CPS", "RPS") + ) self._spec_tbs = tbs # Read from files: @@ -343,7 +342,7 @@ class Layout: return dbc.Col( id="col-plotting-area", children=[ - dcc.Loading( + dbc.Spinner( children=[ dbc.Row( id="plotting-area", @@ -1251,7 +1250,7 @@ class Layout: if on_draw: if store_sel: - lg_selected = get_list_group_items(store_sel) + lg_selected = get_list_group_items(store_sel, "sel-cl") plotting_area = self._get_plotting_area( store_sel, bool(normalize),