feature(web/monitor): cross-reference panel with baseline selector#176
Open
jamby77 wants to merge 1 commit into
Open
feature(web/monitor): cross-reference panel with baseline selector#176jamby77 wants to merge 1 commit into
jamby77 wants to merge 1 commit into
Conversation
8 tasks
ee6ab3a to
f9d35df
Compare
2337652 to
b18f9a7
Compare
f9d35df to
b90faee
Compare
b18f9a7 to
b90faee
Compare
5ab957e to
8199111
Compare
Wires the cross-reference engine from PR 12 into the session-detail
page. Four-section panel displays new command shapes, hot-key delta,
slowlog regressions, and ACL / audit deltas. A baseline selector
swaps between 6h / 24h / 7d / same-hour-last-week and triggers a
fresh compute via react-query.
- New CrossReferencePanel component (one per file).
- 4 Section cards in a 2x2 grid:
- New command shapes: counted, with a script badge for EVALSHA /
FCALL / FCALL_RO rows; empty-state copy "every captured command
was seen in baseline".
- Hot-key delta: two sub-lists — newInTopK (rank #N) and
rankChanges (#baseline ↑/↓ #capture with arrow); empty-state
"No hot-key shifts".
- Slowlog regressions: per verb, observed/s vs baseline p95/s;
empty-state explains the meaning.
- ACL / audit deltas: audit count + INFO counter deltas, with a
note that the counter delta is pending session-boundary
snapshots (follow-up PR).
- Baseline selector is a <select> bound to react-query so caching
works per (sessionId, baseline) tuple — switching back and forth
is instant after the first compute. A small "refreshing…"
indicator shows when the query is refetching in the background.
- API client extended with crossReference(sessionId, baseline) and
the full CrossReferenceResult shape mirrored from the backend.
Verification (Playwright, live):
- Seeded slowlog with a GET row 10 min before session start.
- Captured a session with GET foo (×5) + LPUSH x v (×5).
- /monitor/sessions/:id renders all 4 sections.
- 24h baseline → newShapes shows LPUSH:2, AUTH:1, PING:0 (GET:1
correctly absent — baseline covers it). Hot keys foo + x flagged
in newInTopK.
- Switching baseline to same-hour-last-week → GET:1 flips back into
newShapes (the seeded row is 10 min ago, not in last week's
one-hour window).
Screenshots:
- docs/assets/pr13-cross-reference-24h.png
- docs/assets/pr13-cross-reference-same-hour-last-week.png
Part of PR 13 of 25 in
docs/plans/specs/monitor-command/plan-implementation.md (Phase 3,
closes the cross-reference frontend).
e891dea to
5ef9408
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
PR 13 of 25 in
docs/plans/specs/monitor-command/plan-implementation.md. Closes the Phase 3 cross-reference frontend. Stacked on top of #175 (PR 12). Wires the cross-reference engine into the session-detail page: a four-section panel displays new command shapes, hot-key delta, slowlog regressions, and ACL/audit deltas. A baseline selector swaps between6h / 24h / 7d / same-hour-last-weekand triggers a fresh compute via react-query.Components
CrossReferencePanel(one per file).scriptbadge for EVALSHA / FCALL / FCALL_RO rows; empty-state copy"every captured command was seen in baseline".newInTopK(rank #N) andrankChanges(#baseline ↑/↓ #capture with arrow); empty-state"No hot-key shifts".<select>bound to react-query so caching works per(sessionId, baseline)tuple — switching back and forth is instant after the first compute. A small"refreshing…"indicator shows when the query is refetching in the background.API client
crossReference(sessionId, baseline)and the fullCrossReferenceResultTypeScript shape mirrored from the backend (CrossReferenceNewShape,CrossReferenceHotKey,CrossReferenceSlowlogRegression, etc.).Test plan
pnpm --filter web exec tsc --noEmit→ exit 0MONITOR_DEV_PREVIEW=true pnpm dev:apiandVITE_MONITOR_DEV_PREVIEW=true pnpm dev:webvalkey-cli GET foo+valkey-cli LPUSH x vagainst ValkeynewShapesshowsLPUSH:2etc. but NOTGET:1(baseline covers it)foo+xin newInTopKsame-hour-last-week→ panel refetches;GET:1reappears in newShapes (seeded row is not in last week's hour window); the rest of the values reflect the new windowNotes for reviewers
['monitor', 'cross-reference', sessionId, baseline]so a user toggling 24h ↔ 7d only pays the network round-trip once per window.refetchOnWindowFocusis off to avoid surprising recomputes.—with a small footer note explaining what's pending. When PR 12's follow-up lands (session-boundary INFO snapshots), the counters will populate without any UI change required.(redacted)— that's the server-side MONITOR redaction (Valkey-internal), surfaced unchanged here. Worth flagging as a UX touch-up later: we could suppress(redacted)rows from the hot-key list entirely.docs/assets/:pr13-cross-reference-24h.pngpr13-cross-reference-same-hour-last-week.pngStacked PR
Base branch is
feature/monitor-cross-reference(#175), so the diff shown is ONLY PR 13 changes.Phase 3 done
Phase 3 (cross-reference engine + UI) is now complete. Next is Phase 4 (PR 14): cluster per-node selector + opt-in fan-out + partial-failure handling.