X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=csit.infra.dash%2Fapp%2Fcdash%2Fcomparisons%2Ftables.py;h=ab99f1839d662e4eb7bd2ea97df577c6f22e86c4;hb=7d3054dede4f630e9b20ac0e69f029bea93bdf5f;hp=b2bee7f9d45ceec8af5a70d95230335303ab107f;hpb=1717743a03a2fdd08db080bc705101f9754bf673;p=csit.git diff --git a/csit.infra.dash/app/cdash/comparisons/tables.py b/csit.infra.dash/app/cdash/comparisons/tables.py index b2bee7f9d4..ab99f1839d 100644 --- a/csit.infra.dash/app/cdash/comparisons/tables.py +++ b/csit.infra.dash/app/cdash/comparisons/tables.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Cisco and/or its affiliates. +# Copyright (c) 2024 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -18,6 +18,7 @@ import pandas as pd from numpy import mean, std from copy import deepcopy + from ..utils.constants import Constants as C from ..utils.utils import relative_change_stdev @@ -70,8 +71,12 @@ def select_comparison_data( for itm in data_in["test_id"].unique().tolist(): itm_lst = itm.split(".") test = itm_lst[-1].rsplit("-", 1)[0] + if "hoststack" in itm: + test_type = f"hoststack-{ttype}" + else: + test_type = ttype df = data_in.loc[(data_in["test_id"] == itm)] - l_df = df[C.VALUE_ITER[ttype]].to_list() + l_df = df[C.VALUE_ITER[test_type]].to_list() if len(l_df) and isinstance(l_df[0], list): tmp_df = list() for l_itm in l_df: @@ -85,7 +90,7 @@ def select_comparison_data( d_data["name"].append(f"{test.replace(f'{drv}-', '')}-{ttype}") d_data["mean"].append(int(mean_val * norm_factor)) d_data["stdev"].append(int(std_val * norm_factor)) - d_data["unit"].append(df[C.UNIT[ttype]].to_list()[0]) + d_data["unit"].append(df[C.UNIT[test_type]].to_list()[0]) return pd.DataFrame(d_data) lst_df = list() @@ -108,11 +113,17 @@ def select_comparison_data( drv = "" if itm["driver"] == "dpdk" else itm["driver"].replace("_", "-") core = str() if itm["dut"] == "trex" else itm["core"].lower() - reg_id = \ - f"^.*[.|-]{itm['nic']}.*{itm['frmsize'].lower()}-{core}-{drv}.*$" + ttype = "ndrpdr" if itm["ttype"] in ("NDR", "PDR", "Latency") \ + else itm["ttype"].lower() tmp_df = tmp_df[ (tmp_df.job.str.endswith(itm["tbed"])) & - (tmp_df.test_id.str.contains(reg_id, regex=True)) + (tmp_df.test_id.str.contains( + ( + f"^.*[.|-]{itm['nic']}.*{itm['frmsize'].lower()}-" + f"{core}-{drv}.*-{ttype}$" + ), + regex=True + )) ] if itm["driver"] == "dpdk": for drv in C.DRIVERS: