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')}<br>"
+ f"trend [pps]: {trend_avg[idx]}<br>"
+ 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",
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:
fig.add_traces(traces)
layout_hdrh = layout.get("plot-hdrh-latency", None)
if lat_hdrh:
- layout_hdrh["title"]["text"] = f"<b>{name}</b>"
fig.update_layout(layout_hdrh)
return fig