aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/dash/app/pal/trending/graphs.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2022-05-03 15:41:11 +0200
committerTibor Frank <tifrank@cisco.com>2022-05-05 05:22:02 +0000
commit650d20f1fc6bdea669982f2a549744fcdcce5a37 (patch)
tree74fd4876d39618e35ce874dc262bee706564e10b /resources/tools/dash/app/pal/trending/graphs.py
parent1daa6fdc0bae284dee1b61f34534e59b60b7526a (diff)
feat(uti): Generate structure of tests from data for trending
Change-Id: I14a59da85112473fde342b2f687bd87256a7d416 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/dash/app/pal/trending/graphs.py')
-rw-r--r--resources/tools/dash/app/pal/trending/graphs.py41
1 files changed, 18 insertions, 23 deletions
diff --git a/resources/tools/dash/app/pal/trending/graphs.py b/resources/tools/dash/app/pal/trending/graphs.py
index 1d9fd1ccfa..3b81cf39c4 100644
--- a/resources/tools/dash/app/pal/trending/graphs.py
+++ b/resources/tools/dash/app/pal/trending/graphs.py
@@ -172,23 +172,21 @@ def select_trending_data(data: pd.DataFrame, itm:dict) -> pd.DataFrame:
drv = drv.replace("_", "-")
else:
return None
- cadence = \
- "weekly" if (arch == "aws" or itm["testtype"] != "mrr") else "daily"
- sel_topo_arch = (
- f"csit-vpp-perf-"
- f"{itm['testtype'] if itm['testtype'] == 'mrr' else 'ndrpdr'}-"
- f"{cadence}-master-{topo}-{arch}"
- )
- df_sel = data.loc[(data["job"] == sel_topo_arch)]
- regex = (
- f"^.*{nic}.*\.{itm['framesize']}-{itm['core']}-{drv}{itm['test']}-"
- f"{'mrr' if itm['testtype'] == 'mrr' else 'ndrpdr'}$"
- )
- df = df_sel.loc[
- df_sel["test_id"].apply(
- lambda x: True if re.search(regex, x) else False
- )
- ].sort_values(by="start_time", ignore_index=True)
+
+ core = str() if itm["dut"] == "trex" else f"{itm['core']}"
+ ttype = "ndrpdr" if itm["testtype"] in ("ndr", "pdr") else itm["testtype"]
+ dut = "none" if itm["dut"] == "trex" else itm["dut"].upper()
+
+ df = data.loc[(
+ (data["dut_type"] == dut) &
+ (data["test_type"] == ttype) &
+ (data["passed"] == True)
+ )]
+ df = df[df.job.str.endswith(f"{topo}-{arch}")]
+ df = df[df.test_id.str.contains(
+ f"^.*[.|-]{nic}.*{itm['framesize']}-{core}-{drv}{itm['test']}-{ttype}$",
+ regex=True
+ )].sort_values(by="start_time", ignore_index=True)
return df
@@ -357,14 +355,11 @@ def graph_trending(data: pd.DataFrame, sel:dict, layout: dict,
for idx, itm in enumerate(sel):
df = select_trending_data(data, itm)
- if df is None:
+ if df is None or df.empty:
continue
- name = (
- f"{itm['phy']}-{itm['framesize']}-{itm['core']}-"
- f"{itm['test']}-{itm['testtype']}"
- )
-
+ name = "-".join((itm["dut"], itm["phy"], itm["framesize"], itm["core"],
+ itm["test"], itm["testtype"], ))
traces = _generate_trending_traces(
itm["testtype"], name, df, start, end, _COLORS[idx % len(_COLORS)]
)