aboutsummaryrefslogtreecommitdiffstats
path: root/csit.infra.dash/app/cdash/trending/graphs.py
diff options
context:
space:
mode:
Diffstat (limited to 'csit.infra.dash/app/cdash/trending/graphs.py')
-rw-r--r--csit.infra.dash/app/cdash/trending/graphs.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/csit.infra.dash/app/cdash/trending/graphs.py b/csit.infra.dash/app/cdash/trending/graphs.py
index 7d747756a5..7b14501dec 100644
--- a/csit.infra.dash/app/cdash/trending/graphs.py
+++ b/csit.infra.dash/app/cdash/trending/graphs.py
@@ -389,8 +389,8 @@ def graph_tm_trending(
:rtype: list
"""
traces = list()
- nr_of_metrics = len(data.tm_metric.unique())
- for idx, metric in enumerate(data.tm_metric.unique()):
+ metrics = data.tm_metric.unique().tolist()
+ for idx, metric in enumerate(metrics):
if "-pdr" in test and "='pdr'" not in metric:
continue
if "-ndr" in test and "='ndr'" not in metric:
@@ -449,7 +449,7 @@ def graph_tm_trending(
else:
anomalies = None
if all_in_one:
- color = get_color(color_index * nr_of_metrics + idx)
+ color = get_color(color_index * len(metrics) + idx)
metric_name = f"{test}<br>{metric}"
else:
color = get_color(idx)
@@ -543,7 +543,10 @@ def graph_tm_trending(
)
)
- return traces
+ unique_metrics = set()
+ for itm in metrics:
+ unique_metrics.add(itm.split("{", 1)[0])
+ return traces, unique_metrics
tm_trending_graphs = list()
graph_layout = layout.get("plot-trending-telemetry", dict())
@@ -551,22 +554,26 @@ def graph_tm_trending(
if all_in_one:
all_traces = list()
+ all_metrics = set()
+ all_tests = list()
for idx, test in enumerate(data.test_name.unique()):
df = data.loc[(data["test_name"] == test)]
- traces = _generate_traces(df, test, all_in_one, idx)
+ traces, metrics = _generate_traces(df, test, all_in_one, idx)
if traces:
+ all_metrics.update(metrics)
if all_in_one:
all_traces.extend(traces)
+ all_tests.append(test)
else:
graph = go.Figure()
graph.add_traces(traces)
graph.update_layout(graph_layout)
- tm_trending_graphs.append((graph, test, ))
+ tm_trending_graphs.append((graph, [test, ], ))
if all_in_one:
graph = go.Figure()
graph.add_traces(all_traces)
graph.update_layout(graph_layout)
- tm_trending_graphs.append((graph, str(), ))
+ tm_trending_graphs.append((graph, all_tests, ))
- return tm_trending_graphs
+ return tm_trending_graphs, all_metrics