+
+ phy = itm["phy"].split("-")
+ if len(phy) == 4:
+ topo, arch, nic, drv = phy
+ if drv == "dpdk":
+ drv = ""
+ else:
+ drv += "-"
+ drv = drv.replace("_", "-")
+ else:
+ return None
+
+ core = str() if itm["dut"] == "trex" else f"{itm['core']}"
+ ttype = "ndrpdr" if itm["testtype"] in ("ndr", "pdr") else itm["testtype"]
+ dut_v100 = "none" if itm["dut"] == "trex" else itm["dut"]
+ dut_v101 = itm["dut"]
+
+ df = data.loc[(
+ (
+ (
+ (data["version"] == "1.0.0") &
+ (data["dut_type"].str.lower() == dut_v100)
+ ) |
+ (
+ (data["version"] == "1.0.1") &
+ (data["dut_type"].str.lower() == dut_v101)
+ )
+ ) &
+ (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
+
+
+def _generate_trending_traces(ttype: str, name: str, df: pd.DataFrame,
+ start: datetime, end: datetime, color: str, norm_factor: float) -> list:
+ """Generate the trending traces for the trending graph.
+
+ :param ttype: Test type (MRR, NDR, PDR).
+ :param name: The test name to be displayed as the graph title.
+ :param df: Data frame with test data.
+ :param start: The date (and time) when the selected data starts.
+ :param end: The date (and time) when the selected data ends.
+ :param color: The color of the trace (samples and trend line).
+ :param norm_factor: The factor used for normalization of the results to CPU
+ frequency set to Constants.NORM_FREQUENCY.
+ :type ttype: str
+ :type name: str
+ :type df: pandas.DataFrame
+ :type start: datetime.datetime
+ :type end: datetime.datetime
+ :type color: str
+ :type norm_factor: float
+ :returns: Traces (samples, trending line, anomalies)
+ :rtype: list