diff options
author | Tibor Frank <tifrank@cisco.com> | 2023-06-23 07:58:36 +0000 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2023-06-23 08:02:36 +0000 |
commit | c17ad9031ead7a9d658f9e83e78a494dfa0ed040 (patch) | |
tree | ec8d7681f4d932b54255a05f8838b728d6ddbd87 /csit.infra.dash/app/cdash | |
parent | 575941328d025997c20ee30e7f85835a9510415e (diff) |
C-Dash: Add hyperlinks to job/builds
- performance trending
- test job statistics
- per release performance
Change-Id: I2b0479120906b79d45b1887be1e8bb72d9845585
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'csit.infra.dash/app/cdash')
-rw-r--r-- | csit.infra.dash/app/cdash/report/graphs.py | 6 | ||||
-rw-r--r-- | csit.infra.dash/app/cdash/report/layout.py | 39 | ||||
-rw-r--r-- | csit.infra.dash/app/cdash/stats/layout.py | 61 | ||||
-rw-r--r-- | csit.infra.dash/app/cdash/trending/layout.py | 32 | ||||
-rw-r--r-- | csit.infra.dash/app/cdash/utils/constants.py | 3 |
5 files changed, 97 insertions, 44 deletions
diff --git a/csit.infra.dash/app/cdash/report/graphs.py b/csit.infra.dash/app/cdash/report/graphs.py index f45e17ff33..cff5bb6b02 100644 --- a/csit.infra.dash/app/cdash/report/graphs.py +++ b/csit.infra.dash/app/cdash/report/graphs.py @@ -128,6 +128,9 @@ def graph_iterative(data: pd.DataFrame, sel:dict, layout: dict, y_tput_max = max(max(y_data), y_tput_max) nr_of_samples = len(y_data) + c_data = list() + for _, row in itm_data.iterrows(): + c_data.append(f"{row['job']}/{row['build']}") tput_kwargs = dict( y=y_data, name=( @@ -139,7 +142,8 @@ def graph_iterative(data: pd.DataFrame, sel:dict, layout: dict, hoverinfo=u"y+name", boxpoints="all", jitter=0.3, - marker=dict(color=get_color(idx)) + marker=dict(color=get_color(idx)), + customdata=c_data ) tput_traces.append(go.Box(**tput_kwargs)) show_tput = True diff --git a/csit.infra.dash/app/cdash/report/layout.py b/csit.infra.dash/app/cdash/report/layout.py index 06b5d467dc..fcea2ab3d0 100644 --- a/csit.infra.dash/app/cdash/report/layout.py +++ b/csit.infra.dash/app/cdash/report/layout.py @@ -1422,22 +1422,34 @@ class Layout: if len(graph_data) == 1: hdrh_data = graph_data[0].get("customdata", None) if hdrh_data: + name = hdrh_data.pop("name") graph = [dbc.Card( class_name="gy-2 p-0", children=[ - dbc.CardHeader(hdrh_data.pop("name")), - dbc.CardBody(children=[ - dcc.Graph( - id="hdrh-latency-graph", - figure=graph_hdrh_latency( - hdrh_data, self._graph_layout - ) + dbc.CardHeader(html.A( + name, + href=f"{C.URL_JENKINS}{name}", + target="_blank" + )), + dbc.CardBody(dcc.Graph( + id="hdrh-latency-graph", + figure=graph_hdrh_latency( + hdrh_data, self._graph_layout ) - ]) + )) ]) ] else: raise PreventUpdate + list_group_items = list() + for k, v in _process_stats(graph_data, trigger.idx): + list_group_items.append(dbc.ListGroupItem([dbc.Badge(k), v])) + if trigger.idx == "tput" and len(list_group_items) == 1: + job = graph_data[0].get("customdata", "") + list_group_items.append(dbc.ListGroupItem([ + dbc.Badge("csit-ref"), + html.A(job, href=f"{C.URL_JENKINS}{job}", target="_blank") + ])) metadata = [ dbc.Card( class_name="gy-2 p-0", @@ -1451,16 +1463,9 @@ class Layout: title ]), dbc.CardBody( + dbc.ListGroup(list_group_items, flush=True), id="tput-lat-metadata", - class_name="p-0", - children=[dbc.ListGroup( - [ - dbc.ListGroupItem([dbc.Badge(k), v]) - for k, v in _process_stats( - graph_data, trigger.idx) - ], - flush=True) - ] + class_name="p-0" ) ] ) diff --git a/csit.infra.dash/app/cdash/stats/layout.py b/csit.infra.dash/app/cdash/stats/layout.py index 574479e123..c818d91312 100644 --- a/csit.infra.dash/app/cdash/stats/layout.py +++ b/csit.infra.dash/app/cdash/stats/layout.py @@ -194,7 +194,11 @@ class Layout: "ri-ttypes-value": self._default["ttype"], "ri-cadences-value": self._default["cadence"], "dd-tbeds-value": self._default["tbed"], - "al-job-children": self._default["job"] + "al-job-children": html.A( + self._default["job"], + href=f"{C.URL_JENKINS}{self._default['job']}", + target="_blank" + ) } # Callbacks: @@ -671,7 +675,14 @@ class Layout: "ri-ttypes-value": job_params["ttype"], "ri-cadences-value": job_params["cadence"], "dd-tbeds-value": job_params["tbed"], - "al-job-children": job_params["job"] + "al-job-children": html.A( + self._default["job"], + href=( + f"{C.URL_JENKINS}" + f"{self._default['job']}" + ), + target="_blank" + ) }, None ) @@ -686,7 +697,15 @@ class Layout: ctrl_panel.get("dd-tbeds-value") ) - ctrl_panel.set({"al-job-children": job}) + ctrl_panel.set( + { + "al-job-children": html.A( + self._default["job"], + href=f"{C.URL_JENKINS}{self._default['job']}", + target="_blank" + ) + } + ) plotting_area = self._get_plotting_area( job, gen_new_url(parsed_url, {"job": job}) @@ -804,11 +823,29 @@ class Layout: fail_tests = None # Create the content of the offcanvas: + list_group_items = list() + for itm in lst_graph_data: + lst_itm = itm.split(": ") + if lst_itm[0] == "csit-ref": + list_group_item = dbc.ListGroupItem([ + dbc.Badge(lst_itm[0]), + html.A( + lst_itm[1], + href=f"{C.URL_JENKINS}{lst_itm[1]}", + target="_blank" + ) + ]) + else: + list_group_item = dbc.ListGroupItem([ + dbc.Badge(lst_itm[0]), + lst_itm[1] + ]) + list_group_items.append(list_group_item) metadata = [ dbc.Card( class_name="gy-2 p-0", children=[ - dbc.CardHeader(children=[ + dbc.CardHeader([ dcc.Clipboard( target_id="metadata", title="Copy", @@ -817,21 +854,9 @@ class Layout: title ]), dbc.CardBody( + dbc.ListGroup(list_group_items, flush=True), id="metadata", - class_name="p-0", - children=[dbc.ListGroup( - children=[ - dbc.ListGroupItem( - [ - dbc.Badge( - x.split(":")[0] - ), - x.split(": ")[1] - ] - ) for x in lst_graph_data - ], - flush=True), - ] + class_name="p-0" ) ] ) diff --git a/csit.infra.dash/app/cdash/trending/layout.py b/csit.infra.dash/app/cdash/trending/layout.py index f84f8b1cd9..84a68f5050 100644 --- a/csit.infra.dash/app/cdash/trending/layout.py +++ b/csit.infra.dash/app/cdash/trending/layout.py @@ -1698,11 +1698,27 @@ class Layout: metadata = no_update graph = list() - children = [ - dbc.ListGroupItem( - [dbc.Badge(x.split(":")[0]), x.split(": ")[1]] - ) for x in graph_data.get("text", "").split("<br>") - ] + list_group_items = list() + for itm in graph_data.get("text", None).split("<br>"): + if not itm: + continue + lst_itm = itm.split(": ") + if lst_itm[0] == "csit-ref": + list_group_item = dbc.ListGroupItem([ + dbc.Badge(lst_itm[0]), + html.A( + lst_itm[1], + href=f"{C.URL_JENKINS}{lst_itm[1]}", + target="_blank" + ) + ]) + else: + list_group_item = dbc.ListGroupItem([ + dbc.Badge(lst_itm[0]), + lst_itm[1] + ]) + list_group_items.append(list_group_item) + if trigger.idx == "tput": title = "Throughput" elif trigger.idx == "lat": @@ -1713,14 +1729,14 @@ class Layout: class_name="gy-2 p-0", children=[ dbc.CardHeader(hdrh_data.pop("name")), - dbc.CardBody(children=[ + dbc.CardBody( dcc.Graph( id="hdrh-latency-graph", figure=graph_hdrh_latency( hdrh_data, self._graph_layout ) ) - ]) + ) ]) ] else: @@ -1739,9 +1755,9 @@ class Layout: title ]), dbc.CardBody( + dbc.ListGroup(list_group_items, flush=True), id="tput-lat-metadata", class_name="p-0", - children=[dbc.ListGroup(children, flush=True), ] ) ] ) diff --git a/csit.infra.dash/app/cdash/utils/constants.py b/csit.infra.dash/app/cdash/utils/constants.py index b797ac2cf5..ee421f1aec 100644 --- a/csit.infra.dash/app/cdash/utils/constants.py +++ b/csit.infra.dash/app/cdash/utils/constants.py @@ -44,6 +44,9 @@ class Constants: # External stylesheets. EXTERNAL_STYLESHEETS = ["/static/dist/css/bootstrap.css", ] + # URL to Jenkins + URL_JENKINS = "https://jenkins.fd.io/job/" + # URL to the documentation URL_DOC_TRENDING = "https://csit.fd.io/cdocs/methodology/trending/analysis/" URL_DOC_REL_NOTES = "https://csit.fd.io/cdocs/release_notes/csit_rls2306/" |