feat(admin): HTTP request analytics on Traces view (v26.05.10)#21
Merged
Conversation
The Traces view now leads with live request analytics computed from the trace stream: - Stat cards: Total Requests, Avg Duration, Error Rate (4xx+5xx %, tinted amber/red when elevated), Max Latency. - Status Mix: a segmented bar + legend with the 2xx/3xx/4xx/5xx split (counts + percentages). - Latency Distribution: a histogram across buckets (<10ms … ≥1s) plus a p50/p90/p95/p99 percentile strip. - All update live as requests arrive (debounced refresh), reset on Clear. Hardening (from adversarial review): - Bound the client trace buffer to 500 (matching the server ring buffer): the in-memory array, the table DOM and the per-refresh O(n log n) analytics no longer grow without bound on a long-lived tab. - Fix a latent bug where a live insert left a stale "No traces" placeholder. - Avg Duration reads '--' (not '0.0 ms') when no trace carries a duration. - The decorative status bar is aria-hidden; the legend carries the numbers. - cleanup() disconnects SSE, clears the debounce timer, and destroys the chart. Responsive (cards/charts stack + resize on mobile) and theme-aware (dark + light). Verified live via Playwright (desktop/light/dark/mobile, live SSE insert, filter placeholder, navigation cleanup). Gates green: ruff, format, mypy --strict (577 files); 352 admin+web tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The admin Traces view now leads with live HTTP request analytics, computed entirely client-side from the trace stream:
<10ms…≥1s) plus a p50 / p90 / p95 / p99 percentile strip.Hardening (from the adversarial review workflow)
A 3-dimension review (lifecycle / analytics / CSS-a11y) with independent verification confirmed 5 findings; all addressed:
O(n log n)analytics no longer grow without bound on a long-lived tab (matches the server ring buffer). (high)--(not0.0 ms) when no trace carries a duration, consistent with Max/percentiles. (nit)aria-hidden; the legend carries the numbers for assistive tech. (a11y)cleanup()disconnects SSE, clears the debounce timer, and destroys the chart.Verification (Playwright, live)
Desktop + light & dark themes, mobile 390px (no overflow, cards/charts stack & resize), live SSE insert (Total 74→79 as requests streamed), filter→placeholder→back, and navigation cleanup (re-entry works, zero console errors). Status mix / percentiles / histogram all numerically correct against generated 2xx+4xx traffic.
Gates
ruff✓ ·ruff format --check✓ ·mypy --strict(577 files) ✓ ·pytest tests/admin tests/web→ 352 passed.Version
Bumps to v26.05.10 (pyproject
26.5.10,__version__, uv.lock). CHANGELOG + admin docs updated. JS/CSS-only feature (no Python changes).