feat(tui): response time distribution histogram in full-screen detail
Horizontal bar chart showing latency distribution across 5 buckets: 0-50ms, 50-100ms, 100-200ms, 200-500ms, 500ms+. Color-coded green (fast), yellow (medium), red (slow). Shows count per bucket. Appears in the full-screen detail panel (Enter) after the sparkline stats. Skipped for push monitors (no latency data).
This commit is contained in:
@@ -258,6 +258,15 @@ func (m Model) viewDetailPanel() string {
|
||||
b.WriteString("\n" + m.renderSparkTooltip(site, hist, detailSparkWidth))
|
||||
}
|
||||
|
||||
if site.Type != "push" && len(hist.Latencies) > 5 {
|
||||
histW := m.termWidth - chromePadH - 4
|
||||
if histW < 30 {
|
||||
histW = 30
|
||||
}
|
||||
b.WriteString("\n\n" + m.st.subtleStyle.Render(" RESPONSE TIME DISTRIBUTION") + "\n")
|
||||
b.WriteString(m.latencyHistogram(hist.Latencies, hist.Statuses, histW))
|
||||
}
|
||||
|
||||
b.WriteString("\n")
|
||||
b.WriteString(m.divider() + "\n")
|
||||
b.WriteString(m.st.subtleStyle.Render(" [q/Esc] Back [e] Edit [h] History [s] SLA [click] Inspect"))
|
||||
|
||||
Reference in New Issue
Block a user