diff options
Diffstat (limited to 'csit.infra.dash/app/cdash/utils')
-rw-r--r-- | csit.infra.dash/app/cdash/utils/constants.py | 2 | ||||
-rw-r--r-- | csit.infra.dash/app/cdash/utils/telemetry_data.py | 7 | ||||
-rw-r--r-- | csit.infra.dash/app/cdash/utils/utils.py | 22 |
3 files changed, 28 insertions, 3 deletions
diff --git a/csit.infra.dash/app/cdash/utils/constants.py b/csit.infra.dash/app/cdash/utils/constants.py index 3b6e125d8e..444ccd3981 100644 --- a/csit.infra.dash/app/cdash/utils/constants.py +++ b/csit.infra.dash/app/cdash/utils/constants.py @@ -331,7 +331,7 @@ class Constants: } VALUE_ITER = { - "mrr": "result_receive_rate_rate_values", + "mrr": "result_receive_rate_rate_avg", "ndr": "result_ndr_lower_rate_value", "pdr": "result_pdr_lower_rate_value", "mrr-bandwidth": "result_receive_rate_bandwidth_avg", diff --git a/csit.infra.dash/app/cdash/utils/telemetry_data.py b/csit.infra.dash/app/cdash/utils/telemetry_data.py index c63ee0057a..d3a114c596 100644 --- a/csit.infra.dash/app/cdash/utils/telemetry_data.py +++ b/csit.infra.dash/app/cdash/utils/telemetry_data.py @@ -283,8 +283,11 @@ class TelemetryData: for _, row in self._unique_metrics_labels.iterrows(): if _is_selected(row["labels"], selection): lst_items.append(row.to_frame().T) - self._selected_metrics_labels = \ - pd.concat(lst_items, ignore_index=True, axis=0, copy=False) + if len(lst_items) == 1: + self._selected_metrics_labels = lst_items[0] + elif len(lst_items) > 1: + self._selected_metrics_labels = \ + pd.concat(lst_items, ignore_index=True, axis=0, copy=False) return self._selected_metrics_labels def select_tm_trending_data( diff --git a/csit.infra.dash/app/cdash/utils/utils.py b/csit.infra.dash/app/cdash/utils/utils.py index 62d4770937..8171c905c3 100644 --- a/csit.infra.dash/app/cdash/utils/utils.py +++ b/csit.infra.dash/app/cdash/utils/utils.py @@ -946,3 +946,25 @@ def get_url_logs(job_build: str) -> str: return str() else: return str() + + +def get_topo_arch(lst_job: list) -> str: + """Get the topology and architecture string from the job name. + + :param lst_job: The job name split into substrings. + :type lst_job: list + :returns: String with information about topology and architecture. + :rtype: str + """ + + if len(lst_job) < 2: + return str() + + if "x" in lst_job[1:-1]: + # External testbeds. + # The structure of the name: + # <to be removed>-x-<topo>-<arch>-<other parts separated by dashes> + return "-".join(lst_job[(lst_job.index("x") + 1):]) + else: + # Topology and architecture are the last two substrings. + return "-".join(lst_job[-2:]) |