diff options
author | Tibor Frank <tifrank@cisco.com> | 2022-07-18 10:12:45 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2022-07-18 10:14:35 +0200 |
commit | 2f6295d7c63b7e231b0198ee055468b2fc54fa94 (patch) | |
tree | 1689a4e99e6632d9398cebd2999f58fda11123db /resources/tools | |
parent | 16fba5d038e11d16049abd62107880ae5624d383 (diff) |
UTI: Small fixes and improvements
Change-Id: Iff83f4340beb51edbfcba230b60b175ac8c2d6ad
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools')
-rw-r--r-- | resources/tools/dash/app/pal/report/graphs.py | 6 | ||||
-rw-r--r-- | resources/tools/dash/app/pal/trending/graphs.py | 9 | ||||
-rw-r--r-- | resources/tools/dash/app/pal/trending/layout.py | 2 |
3 files changed, 10 insertions, 7 deletions
diff --git a/resources/tools/dash/app/pal/report/graphs.py b/resources/tools/dash/app/pal/report/graphs.py index 0543193d99..76aa8b7793 100644 --- a/resources/tools/dash/app/pal/report/graphs.py +++ b/resources/tools/dash/app/pal/report/graphs.py @@ -186,13 +186,13 @@ def graph_iterative(data: pd.DataFrame, sel:dict, layout: dict, if normalize else 1.0 if itm["testtype"] == "mrr": y_data_raw = itm_data[_VALUE[itm["testtype"]]].to_list()[0] - y_data = [y * norm_factor for y in y_data_raw] + y_data = [(y * norm_factor) for y in y_data_raw] if len(y_data) > 0: y_tput_max = \ max(y_data) if max(y_data) > y_tput_max else y_tput_max else: y_data_raw = itm_data[_VALUE[itm["testtype"]]].to_list() - y_data = [y * norm_factor for y in y_data_raw] + y_data = [(y * norm_factor) for y in y_data_raw] if y_data: y_tput_max = \ max(y_data) if max(y_data) > y_tput_max else y_tput_max @@ -215,7 +215,7 @@ def graph_iterative(data: pd.DataFrame, sel:dict, layout: dict, if itm["testtype"] == "pdr": y_lat_row = itm_data[_VALUE["pdr-lat"]].to_list() - y_lat = [y * norm_factor for y in y_lat_row] + y_lat = [(y / norm_factor) for y in y_lat_row] if y_lat: y_lat_max = max(y_lat) if max(y_lat) > y_lat_max else y_lat_max nr_of_samples = len(y_lat) diff --git a/resources/tools/dash/app/pal/trending/graphs.py b/resources/tools/dash/app/pal/trending/graphs.py index 150b7056ba..8950558166 100644 --- a/resources/tools/dash/app/pal/trending/graphs.py +++ b/resources/tools/dash/app/pal/trending/graphs.py @@ -237,7 +237,10 @@ def _generate_trending_traces(ttype: str, name: str, df: pd.DataFrame, return list() x_axis = df["start_time"].tolist() - y_data = [itm * norm_factor for itm in df[_VALUE[ttype]].tolist()] + if ttype == "pdr-lat": + y_data = [(itm / norm_factor) for itm in df[_VALUE[ttype]].tolist()] + else: + y_data = [(itm * norm_factor) for itm in df[_VALUE[ttype]].tolist()] anomalies, trend_avg, trend_stdev = _classify_anomalies( {k: v for k, v in zip(x_axis, y_data)} @@ -245,11 +248,11 @@ def _generate_trending_traces(ttype: str, name: str, df: pd.DataFrame, hover = list() customdata = list() - for _, row in df.iterrows(): + for idx, (_, row) in enumerate(df.iterrows()): d_type = "trex" if row["dut_type"] == "none" else row["dut_type"] hover_itm = ( f"date: {row['start_time'].strftime('%Y-%m-%d %H:%M:%S')}<br>" - f"<prop> [{row[_UNIT[ttype]]}]: {row[_VALUE[ttype]]:,.0f}<br>" + f"<prop> [{row[_UNIT[ttype]]}]: {y_data[idx]:,.0f}<br>" f"<stdev>" f"{d_type}-ref: {row['dut_version']}<br>" f"csit-ref: {row['job']}/{row['build']}<br>" diff --git a/resources/tools/dash/app/pal/trending/layout.py b/resources/tools/dash/app/pal/trending/layout.py index c21e4b3c2e..d632820b99 100644 --- a/resources/tools/dash/app/pal/trending/layout.py +++ b/resources/tools/dash/app/pal/trending/layout.py @@ -1213,7 +1213,7 @@ class Layout: row_card_sel_tests = self.STYLE_ENABLED row_btns_sel_tests = self.STYLE_ENABLED - if trigger_id in ("btn-ctrl-add", "url", "dpr-period" + if trigger_id in ("btn-ctrl-add", "url", "dpr-period", "btn-sel-remove", "cl-ctrl-normalize"): if store_sel: row_fig_tput, row_fig_lat, row_btn_dwnld = \ |