X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fdash%2Fapp%2Fpal%2Ftrending%2Fgraphs.py;h=6e0bcb55ebd25d2c1ebef362e866078a180384f7;hb=65421a4ebc81c4e163b3cb38dd6d095b8e99f2d4;hp=dc4e7afca8a82f465f7b2833c411ef7c16dca707;hpb=ab10e17fd7853043afde6af25921f6ab636e0964;p=csit.git
diff --git a/resources/tools/dash/app/pal/trending/graphs.py b/resources/tools/dash/app/pal/trending/graphs.py
index dc4e7afca8..6e0bcb55eb 100644
--- a/resources/tools/dash/app/pal/trending/graphs.py
+++ b/resources/tools/dash/app/pal/trending/graphs.py
@@ -285,21 +285,31 @@ def _generate_trending_traces(ttype: str, name: str, df: pd.DataFrame,
anomaly_x = list()
anomaly_y = list()
anomaly_color = list()
+ hover = list()
for idx, anomaly in enumerate(anomalies):
if anomaly in (u"regression", u"progression"):
anomaly_x.append(x_axis[idx])
anomaly_y.append(trend_avg[idx])
anomaly_color.append(_ANOMALY_COLOR[anomaly])
+ hover_itm = (
+ f"date: {x_axis[idx].strftime('%d-%m-%Y %H:%M:%S')}
"
+ f"trend [pps]: {trend_avg[idx]}
"
+ f"classification: {anomaly}"
+ )
+ if ttype == "pdr-lat":
+ hover_itm = hover_itm.replace("[pps]", "[us]")
+ hover.append(hover_itm)
anomaly_color.extend([0.0, 0.5, 1.0])
traces.append(
go.Scatter(
x=anomaly_x,
y=anomaly_y,
mode=u"markers",
- hoverinfo=u"none",
+ text=hover,
+ hoverinfo=u"text+name",
showlegend=False,
legendgroup=name,
- name=f"{name}-anomalies",
+ name=name,
marker={
u"size": 15,
u"symbol": u"circle-open",
@@ -386,11 +396,6 @@ def graph_hdrh_latency(data: dict, layout: dict) -> go.Figure:
fig = None
- try:
- name = data.pop("name")
- except (KeyError, AttributeError):
- return None
-
traces = list()
for idx, (lat_name, lat_hdrh) in enumerate(data.items()):
try:
@@ -450,7 +455,6 @@ def graph_hdrh_latency(data: dict, layout: dict) -> go.Figure:
fig.add_traces(traces)
layout_hdrh = layout.get("plot-hdrh-latency", None)
if lat_hdrh:
- layout_hdrh["title"]["text"] = f"{name}"
fig.update_layout(layout_hdrh)
return fig