C-Dash: Add mrr trials to hover and detailed info 53/41153/2
authorTibor Frank <[email protected]>
Tue, 18 Jun 2024 08:16:30 +0000 (08:16 +0000)
committerTibor Frank <[email protected]>
Tue, 18 Jun 2024 08:19:49 +0000 (08:19 +0000)
Change-Id: Ic26cd2aa726f16b3797c269b31e5ad127bbea5b2
Signed-off-by: Tibor Frank <[email protected]>
csit.infra.dash/app/cdash/trending/graphs.py
csit.infra.dash/app/cdash/trending/layout.py

index 8b05f20..10eb392 100644 (file)
@@ -133,7 +133,8 @@ def graph_trending(
         customdata_samples = list()
         name_lst = name.split("-")
         for _, row in df.iterrows():
-            h_tput, h_band, h_lat = str(), str(), str()
+            h_tput, h_band, h_lat, h_tput_trials, h_band_trials = \
+                str(), str(), str(), str(), str()
             if ttype in ("mrr", "mrr-bandwidth"):
                 h_tput = (
                     f"tput avg [{row['result_receive_rate_rate_unit']}]: "
@@ -152,6 +153,23 @@ def graph_trending(
                         f"{row['result_receive_rate_bandwidth_stdev']* nf:,.0f}"
                         "<br>"
                     )
+                if trials:
+                    h_tput_trials = (
+                        f"tput trials "
+                        f"[{row['result_receive_rate_rate_unit']}]: "
+                    )
+                    for itm in row["result_receive_rate_rate_values"]:
+                        h_tput_trials += f"{itm * nf:,.0f}; "
+                    h_tput_trials = h_tput_trials[:-2] + "<br>"
+                    if pd.notna(row["result_receive_rate_bandwidth_avg"]):
+                        h_band_trials = (
+                            f"bandwidth trials "
+                            f"[{row['result_receive_rate_bandwidth_unit']}]: "
+                        )
+                        for itm in row["result_receive_rate_bandwidth_values"]:
+                            h_band_trials += f"{itm * nf:,.0f}; "
+                        h_band_trials = h_band_trials[:-2] + "<br>"
+
             elif ttype in ("ndr", "ndr-bandwidth"):
                 h_tput = (
                     f"tput [{row['result_ndr_lower_rate_unit']}]: "
@@ -224,7 +242,7 @@ def graph_trending(
                 f"infra: {'-'.join(name_lst[1:5])}<br>"
                 f"test: {'-'.join(name_lst[5:])}<br>"
                 f"date: {row['start_time'].strftime('%Y-%m-%d %H:%M:%S')}<br>"
-                f"{h_tput}{h_band}{h_lat}"
+                f"{h_tput}{h_tput_trials}{h_band}{h_band_trials}{h_lat}"
                 f"{row['dut_type']}-ref: {row['dut_version']}<br>"
                 f"csit-ref: {row['job']}/{row['build']}"
                 f"{hosts}"
@@ -419,7 +437,8 @@ def graph_trending(
                     "symbol": "circle"
                 },
                 showlegend=True,
-                legendgroup=name
+                legendgroup=name,
+                hoverinfo="skip"
             ))
         return traces
 
index b4487cf..c844f73 100644 (file)
@@ -611,7 +611,6 @@ class Layout:
             )
         ]
 
-
     def _add_plotting_col(self) -> dbc.Col:
         """Add column with plots. It is placed on the right side.
 
@@ -1117,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])
@@ -1166,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
@@ -1481,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