aboutsummaryrefslogtreecommitdiffstats
path: root/csit.infra.dash/app/cdash/trending/layout.py
diff options
context:
space:
mode:
Diffstat (limited to 'csit.infra.dash/app/cdash/trending/layout.py')
-rw-r--r--csit.infra.dash/app/cdash/trending/layout.py210
1 files changed, 137 insertions, 73 deletions
diff --git a/csit.infra.dash/app/cdash/trending/layout.py b/csit.infra.dash/app/cdash/trending/layout.py
index da90ae26f9..1e2d4cdbd2 100644
--- a/csit.infra.dash/app/cdash/trending/layout.py
+++ b/csit.infra.dash/app/cdash/trending/layout.py
@@ -34,7 +34,7 @@ from ..utils.control_panel import ControlPanel
from ..utils.trigger import Trigger
from ..utils.telemetry_data import TelemetryData
from ..utils.utils import show_tooltip, label, sync_checklists, gen_new_url, \
- generate_options, get_list_group_items, navbar_trending, \
+ generate_options, get_list_group_items, navbar_trending, get_topo_arch, \
show_trending_graph_data
from ..utils.url_processing import url_decode
from .graphs import graph_trending, select_trending_data, graph_tm_trending
@@ -65,7 +65,8 @@ CP_PARAMS = {
"cl-tsttype-all-val": list(),
"cl-tsttype-all-opt": C.CL_ALL_DISABLED,
"btn-add-dis": True,
- "cl-normalize-val": list()
+ "cl-normalize-val": list(),
+ "cl-show-trials": list()
}
@@ -115,7 +116,7 @@ class Layout:
for _, row in self._data[cols].drop_duplicates().iterrows():
lst_job = row["job"].split("-")
dut = lst_job[1]
- tbed = "-".join(lst_job[-2:])
+ tbed = get_topo_arch(lst_job)
lst_test = row["test_id"].split(".")
if dut == "dpdk":
area = "dpdk"
@@ -303,7 +304,7 @@ class Layout:
:returns: Control panel.
:rtype: list
"""
- return [
+ test_selection = [
dbc.Row(
dbc.InputGroup(
[
@@ -459,37 +460,43 @@ class Layout:
class_name="g-0 p-1"
),
dbc.Row(
- dbc.InputGroup(
- [
- dbc.InputGroupText(show_tooltip(
- self._tooltips,
- "help-normalize",
- "Normalization"
- )),
- dbc.Col(dbc.Checklist(
- id="normalize",
- options=[{
- "value": "normalize",
- "label": "Normalize to CPU frequency 2GHz"
- }],
- value=[],
- inline=True,
- class_name="ms-2"
- ))
- ],
- style={"align-items": "center"},
- size="sm"
- ),
- class_name="g-0 p-1"
- ),
- dbc.Row(
dbc.Button(
id={"type": "ctrl-btn", "index": "add-test"},
children="Add Selected",
- color="info"
+ color="info",
+ class_name="p-1"
),
class_name="g-0 p-1"
- ),
+ )
+ ]
+ processing = [
+ dbc.Row(
+ class_name="g-0 p-1",
+ children=[
+ dbc.Checklist(
+ id="normalize",
+ options=[{
+ "value": "normalize",
+ "label": "Normalize to 2GHz CPU frequency"
+ }],
+ value=[],
+ inline=True,
+ class_name="ms-2"
+ ),
+ dbc.Checklist(
+ id="show-trials",
+ options=[{
+ "value": "trials",
+ "label": "Show MRR Trials"
+ }],
+ value=[],
+ inline=True,
+ class_name="ms-2"
+ )
+ ]
+ )
+ ]
+ test_list = [
dbc.Row(
dbc.ListGroup(
class_name="overflow-auto p-0",
@@ -498,39 +505,43 @@ class Layout:
style={"max-height": "20em"},
flush=True
),
- id="row-card-sel-tests",
- class_name="g-0 p-1",
- style=C.STYLE_DISABLED,
+ class_name="g-0 p-1"
),
dbc.Row(
- dbc.ButtonGroup([
- dbc.Button(
- "Remove Selected",
- id={"type": "ctrl-btn", "index": "rm-test"},
- class_name="w-100",
- color="info",
- disabled=False
- ),
- dbc.Button(
- "Remove All",
- id={"type": "ctrl-btn", "index": "rm-test-all"},
- class_name="w-100",
- color="info",
- disabled=False
- )
- ]),
- id="row-btns-sel-tests",
- class_name="g-0 p-1",
- style=C.STYLE_DISABLED,
+ dbc.ButtonGroup(
+ children=[
+ dbc.Button(
+ "Remove Selected",
+ id={"type": "ctrl-btn", "index": "rm-test"},
+ class_name="w-100 p-1",
+ color="info",
+ disabled=False
+ ),
+ dbc.Button(
+ "Remove All",
+ id={"type": "ctrl-btn", "index": "rm-test-all"},
+ class_name="w-100 p-1",
+ color="info",
+ disabled=False
+ )
+ ]
+ ),
+ class_name="g-0 p-1"
),
dbc.Stack(
[
dbc.Button(
"Add Telemetry Panel",
id={"type": "telemetry-btn", "index": "open"},
- color="info"
+ color="info",
+ class_name="p-1"
+ ),
+ dbc.Button(
+ "Show URL",
+ id="plot-btn-url",
+ color="info",
+ class_name="p-1"
),
- dbc.Button("Show URL", id="plot-btn-url", color="info"),
dbc.Modal(
[
dbc.ModalHeader(dbc.ModalTitle("URL")),
@@ -542,13 +553,64 @@ class Layout:
scrollable=True
)
],
- id="row-btns-add-tm",
class_name="g-0 p-1",
- style=C.STYLE_DISABLED,
gap=2
)
]
+ return [
+ dbc.Row(
+ dbc.Card(
+ [
+ dbc.CardHeader(
+ html.H5("Test Selection")
+ ),
+ dbc.CardBody(
+ children=test_selection,
+ class_name="g-0 p-0"
+ )
+ ],
+ color="secondary",
+ outline=True
+ ),
+ class_name="g-0 p-1"
+ ),
+ dbc.Row(
+ dbc.Card(
+ [
+ dbc.CardHeader(
+ html.H5("Data Manipulations")
+ ),
+ dbc.CardBody(
+ children=processing,
+ class_name="g-0 p-0"
+ )
+ ],
+ color="secondary",
+ outline=True
+ ),
+ class_name="g-0 p-1"
+ ),
+ dbc.Row(
+ dbc.Card(
+ [
+ dbc.CardHeader(
+ html.H5("Selected Tests")
+ ),
+ dbc.CardBody(
+ children=test_list,
+ class_name="g-0 p-0"
+ )
+ ],
+ color="secondary",
+ outline=True
+ ),
+ id = "row-selected-tests",
+ class_name="g-0 p-1",
+ style=C.STYLE_DISABLED,
+ )
+ ]
+
def _add_plotting_col(self) -> dbc.Col:
"""Add column with plots. It is placed on the right side.
@@ -919,9 +981,7 @@ class Layout:
Output("plotting-area-trending", "children"),
Output("plotting-area-telemetry", "children"),
Output("col-plotting-area", "style"),
- Output("row-card-sel-tests", "style"),
- Output("row-btns-sel-tests", "style"),
- Output("row-btns-add-tm", "style"),
+ Output("row-selected-tests", "style"),
Output("lg-selected", "children"),
Output({"type": "telemetry-search-out", "index": ALL}, "children"),
Output({"type": "plot-mod-telemetry", "index": ALL}, "is_open"),
@@ -952,6 +1012,7 @@ class Layout:
Output({"type": "ctrl-cl", "index": "tsttype-all"}, "options"),
Output({"type": "ctrl-btn", "index": "add-test"}, "disabled"),
Output("normalize", "value"),
+ Output("show-trials", "value"),
State("store", "data"),
State({"type": "sel-cl", "index": ALL}, "value"),
@@ -968,6 +1029,7 @@ class Layout:
Input({"type": "tm-dd", "index": ALL}, "value"),
Input("normalize", "value"),
+ Input("show-trials", "value"),
Input({"type": "telemetry-search-in", "index": ALL}, "value"),
Input({"type": "telemetry-btn", "index": ALL}, "n_clicks"),
Input({"type": "tm-btn-remove", "index": ALL}, "n_clicks"),
@@ -1054,9 +1116,12 @@ class Layout:
trigger = Trigger(callback_context.triggered)
if trigger.type == "url" and url_params:
telemetry = None
+ normalize = list()
+ show_trials = list()
try:
store_sel = literal_eval(url_params["store_sel"][0])
normalize = literal_eval(url_params["norm"][0])
+ show_trials = literal_eval(url_params["show-trials"][0])
telemetry = literal_eval(url_params["telemetry"][0])
url_p = url_params.get("all-in-one", ["[[None]]"])
tm_all_in_one = literal_eval(url_p[0])
@@ -1103,6 +1168,7 @@ class Layout:
"cl-tsttype-all-val": list(),
"cl-tsttype-all-opt": C.CL_ALL_ENABLED,
"cl-normalize-val": normalize,
+ "cl-show-trials": show_trials,
"btn-add-dis": False
})
store["trending-graphs"] = None
@@ -1119,6 +1185,10 @@ class Layout:
ctrl_panel.set({"cl-normalize-val": trigger.value})
store["trending-graphs"] = None
on_draw[0] = True
+ elif trigger.type == "show-trials":
+ ctrl_panel.set({"cl-show-trials": trigger.value})
+ store["trending-graphs"] = None
+ on_draw[0] = True
elif trigger.type == "ctrl-dd":
if trigger.idx == "dut":
try:
@@ -1414,7 +1484,8 @@ class Layout:
new_url_params = {
"store_sel": store_sel,
- "norm": ctrl_panel.get("cl-normalize-val")
+ "norm": ctrl_panel.get("cl-normalize-val"),
+ "show-trials": ctrl_panel.get("cl-show-trials")
}
if tm_panels:
new_url_params["telemetry"] = tm_panels
@@ -1431,7 +1502,8 @@ class Layout:
self._data,
store_sel,
self._graph_layout,
- bool(ctrl_panel.get("cl-normalize-val"))
+ bool(ctrl_panel.get("cl-normalize-val")),
+ bool(ctrl_panel.get("cl-show-trials"))
)
if graphs and graphs[0]:
store["trending-graphs"] = graphs
@@ -1462,16 +1534,12 @@ class Layout:
store["telemetry-graphs"]
)
col_plotting_area = C.STYLE_ENABLED
- row_card_sel_tests = C.STYLE_ENABLED
- row_btns_sel_tests = C.STYLE_ENABLED
- row_btns_add_tm = C.STYLE_ENABLED
+ row_selected_tests = C.STYLE_ENABLED
else:
plotting_area_trending = no_update
plotting_area_telemetry = C.PLACEHOLDER
col_plotting_area = C.STYLE_DISABLED
- row_card_sel_tests = C.STYLE_DISABLED
- row_btns_sel_tests = C.STYLE_DISABLED
- row_btns_add_tm = C.STYLE_DISABLED
+ row_selected_tests = C.STYLE_DISABLED
lg_selected = no_update
store_sel = list()
tm_panels = list()
@@ -1481,9 +1549,7 @@ class Layout:
else:
plotting_area_trending = no_update
col_plotting_area = no_update
- row_card_sel_tests = no_update
- row_btns_sel_tests = no_update
- row_btns_add_tm = no_update
+ row_selected_tests = no_update
lg_selected = no_update
store["url"] = gen_new_url(parsed_url, new_url_params)
@@ -1499,9 +1565,7 @@ class Layout:
plotting_area_trending,
plotting_area_telemetry,
col_plotting_area,
- row_card_sel_tests,
- row_btns_sel_tests,
- row_btns_add_tm,
+ row_selected_tests,
lg_selected,
search_out,
is_open,