fix: repair hotspot evidence formatting

This commit is contained in:
Brad Stein 2026-02-02 12:20:18 -03:00
parent a6b70e00a0
commit 4e45e1985d

View File

@ -1245,12 +1245,12 @@ def _hotspot_evidence(summary: dict[str, Any]) -> list[str]:
ns_parts = []
for entry in ns_map.get(node, [])[:3]:
if isinstance(entry, (list, tuple)) and len(entry) >= 2:
ns_parts.append(f\"{entry[0]}={entry[1]}\")
ns_text = \", \".join(ns_parts)
value_text = f\"{value:.2f}\" if isinstance(value, (int, float)) else str(value)
line = f\"hotspot.{metric}: node={node} class={node_class or 'unknown'} value={value_text}\"
ns_parts.append(f"{entry[0]}={entry[1]}")
ns_text = ", ".join(ns_parts)
value_text = f"{value:.2f}" if isinstance(value, (int, float)) else str(value)
line = f"hotspot.{metric}: node={node} class={node_class or 'unknown'} value={value_text}"
if ns_text:
line += f\" namespaces_top={ns_text}\"
line += f" namespaces_top={ns_text}"
lines.append(line)
return lines