summaryrefslogtreecommitdiff
path: root/internal/tui/dashboard/model.go
AgeCommit message (Collapse)Author
2026-05-239c move Non-IO grouping policy from core stats/types into dashboardPaul Buetow
Snapshot.NonIOFamilies, Snapshot.NonIOFamiliesCount, and types.IsNonIOSyscallFamily encoded a TUI tab concept in core packages. Move this filtering into internal/tui/dashboard/nonio.go as unexported helpers so the dashboard owns its own grouping policy and Snapshot.Families remains the neutral core API. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18t6 add syscall family dashboard aggregationPaul Buetow
2026-05-14use configurable fastRefreshEvery for InitCmd on flame and stream tabsPaul Buetow
Change tabDescriptor.InitCmd from func() tea.Cmd to func(*Model) tea.Cmd so the initial tick for the flame and stream tabs uses the model's fastRefreshEvery interval rather than hardcoded 200 ms constants. Both call sites in Init() and postKeyTransitionCmd() now pass the model pointer. The now-unused streamTickCmdFn/flameTickCmdFn package-level adapters are removed; the TabFlame and TabStream registry entries use inline closures that delegate to m.flameTickCmd()/m.streamTickCmd(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14wire TUIFastRefreshInterval into dashboard model and update testsPaul Buetow
Add fastRefreshMs parameter to NewModelWithConfig so callers can supply the high-frequency tick cadence for stream and flame tabs. Convert the streamTickCmd/flameTickCmd package-level functions to model methods that honour fastRefreshEvery (falling back to the 200 ms constants when zero for backward-compatibility). Add SetFastRefreshInterval setter so RunWithTraceStarterConfig can apply cfg.TUIFastRefreshInterval after construction. Update all 68 test call sites to pass fastRefreshMs=200 and add three new tests covering zero-fallback, stored value, and setter behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13keep View() pure by moving state transitions into Update() handlersPaul Buetow
The dashboard model's View() was mutating sub-model state on every render: it called streamModel.SetFooterVisible() and flameModel.SetViewport() on local copies instead of keeping those fields in sync through Update(). Moved the sync points to the Update() handlers that trigger each change: - handleWindowSize: syncs stream footer visibility alongside SetViewport - handleHelpToggleKey: already updated flame viewport; now also updates stream footer visibility when the help bar is toggled - handleKey: syncs flame viewport when switching to the flame tab, covering the case that window-resize and help-toggle do not Aligned the stream model's initial showFooter value with the dashboard's default showHelp=false in NewModelWithConfig so there is no mismatch on the first render. Also extracted numeric tab shortcuts into the tab registry via ShortcutKey fields so handleShortcutKey no longer needs updating when tabs are added. Updated two tests that bypassed Update() to set dimensions directly; they now use WindowSizeMsg so sub-model viewports are initialised correctly under the new pure-View contract. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13use errgroup instead of WaitGroup for concurrent snapshot buildersPaul Buetow
Replace sync.WaitGroup with errgroup.Group in buildSubSnapshots so errors from sub-builders (buildSyscallSnapshots, buildFileSnapshots, buildProcessSnapshots, buildHistogramSnapshot) are captured and propagated rather than silently dropped. Change Engine.Snapshot() to return (*Snapshot, error), update runtime.SnapshotSource and dashboard.SnapshotSource interfaces accordingly, and adjust all callers in tui.go, dashboard/model.go, and the test helpers. Each sub-builder now returns (result, error); the error return is currently always nil but establishes the contract for future validation. The per-type Snapshot() convenience methods (histogram, syscall, file, process) panic on error since they are internal helpers where failure would be a programming bug. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13perf: replace string += concatenation with strings.Builder in TUI render hot ↵Paul Buetow
paths Swap out ad-hoc += string concatenation in the flamegraph toolbar/status lines, dashboard filter summary, bubble/treemap status lines, eventstream view, processes tab, and probes list for strings.Builder, eliminating redundant allocations on every render tick. Also update dashboard/model_test.go fake SnapshotSource implementations to match the updated interface signature. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13enforce gofmt formatting and add Fmt/FmtCheck mage targetsPaul Buetow
Run gofmt -w on 9 files that had minor alignment/whitespace drift (pair.go, filter.go, ior_mode_registry.go, ior_mode_test.go, runtime.go, engine.go, dashboard/model.go, flamegraph/model.go, flamegraph/renderer.go). Add two new Mage targets to Magefile.go: - `mage fmt` – rewrites all .go files in-place via go/format - `mage fmtCheck` – dry-run check; fails with a list of offending files, suitable as a CI gate Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13split globalfilter presentation and parsing into sub-packagesPaul Buetow
Move ParseDurationNs to globalfilter/parser and move CompareOpSymbol, AppendStringSummary, AppendNumericSummary, FilterSummary to globalfilter/presenter. The domain Filter type retains only matching, equality, clone, and active-predicate logic. All callers updated; tests for the new sub-packages added. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12extract dashboard tab framework into Tab registry for OCP compliancePaul Buetow
Introduce tabDescriptor struct and tabDescriptors map in new tabregistry.go. Each tab registers its name, short name, ordered position, allowed viz modes, render function, scroll handler, and optional init tick command. Adding a new tab now requires only a single registry entry — no existing switch/if chains need editing. Key changes: - Tab.String() and tabLabel() use lookupTab() instead of a switch - renderActiveTabContent() dispatches via d.Render (replaces renderActiveTab switch) - handleScrollKey() dispatches via d.HandleScroll (replaces tab switch) - Init() and postKeyTransitionCmd() use d.InitCmd (replaces stream/flame tab checks) - allowedVizModes() delegates to tabAllowedVizModes() from registry - orderedTabs() replaces hardcoded allTabs slice, derived from Position field - bubbleChartFor() helper eliminates 5 repeated switch-on-tab for chart ops - toggleBubbleMetric, tickActiveBubbleChart, moveBubbleSelection, activeBubbleChartHasNodes all use bubbleChartFor() - refreshBubbleData split into two focused functions under 50 lines - Two pre-existing test functions over 50 lines refactored All tests pass; go build ./internal/tui/... clean. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12refactor renderActiveContent to stay under 50-line limitPaul Buetow
Extract renderActiveContentViz (treemap/icicle/bubble dispatch) and renderActiveContentTable (table-with-sort dispatch) from the original 56-line renderActiveContent, reducing it to 15 lines of code. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11speed up flame graph TUI under heavy event loadPaul Buetow
Move the per-tick snapshot refresh off the Bubble Tea update goroutine, add a frame ancestry index so navigation and filter helpers run in O(subtree) instead of O(frames), skip refresh and animation while the user is actively pressing keys, and memoize View() output. Keystrokes (pause, filter, navigate) now land within one frame even when the live trie ingests thousands of events per tick. - new SnapshotTree() on LiveTrie bypasses JSON marshal+unmarshal - RefreshFromLiveTrieCmd runs SnapshotTree + layout + ancestry on a background goroutine, coalesced via refreshInFlight, and returns a flameSnapshotReadyMsg the Update loop applies cheaply - driveWindow gate (250 ms after last key press) skips refresh dispatch and snaps frames directly to target without animation while the user is driving - View() caches its rendered string keyed on the inputs that affect output; cache is bypassed during animation Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09show auto-reset countdown and document the cyclePaul Buetow
Renders the next-tick countdown ("12s/30s") in the dashboard chrome so users can see when aggregates will clear, and adds a dedicated H-help line spelling out the cycle keys (off → 10s → 30s → 1m → 2m → 5m). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09refine auto-reset timer cycle and pause on blurPaul Buetow
Two follow-up refinements to the auto-reset timer added in 8da473a. - Hotkey cycle now goes off -> 10s -> 30s -> 60s -> 2m -> 5m -> off, giving the user finer control between 60s and 5m and a quicker starting cadence. - The timer now pauses while the TUI is blurred. SetFocused returns a tea.Cmd that re-arms a fresh tick on focus regain, and bumps the generation counter on every focus change so any tick scheduled before blur is dropped on arrival. autoResetTickCmd and handleAutoResetTick also gate on m.focused as defense in depth. - Dashboard chrome shows 'auto-reset: 30s (paused)' while the timer is enabled but blurred, distinguishing it from the disabled 'off' state. Tests cover the full preset cycle (including custom-value passthrough) and the pause-on-blur lifecycle: stale ticks ignored, current-gen ticks ignored while blurred, focus regain re-arms and fires the reset, no-op focus calls don't churn the generation counter, and the chrome label flips to '(paused)' as expected. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09add auto-reset timer for dashboard aggregatesPaul Buetow
Live flamegraph trie and stats engine grow unboundedly during long traces. Add a periodic auto-reset (same effect as the 'r' key) so they stay bounded. - New CLI flag -resetTimer=30s (default 30s, 0 disables). - Hotkey I cycles the cadence: off -> 15s -> 30s -> 60s -> 5m -> off. Custom intervals (e.g. -resetTimer=47s) advance to the first preset greater than the current value, then wrap to off. - autoResetTickMsg carries a generation counter so changing the cadence drops in-flight ticks scheduled under the previous interval. - Dashboard chrome shows 'auto-reset: 30s' or 'auto-reset: off'.
2026-05-08add duration metric, tolerate missing tracepoints, ship el8 buildPaul Buetow
- Bubbles, treemap, icicle, and the live flamegraph 'b' cycle now include syscall duration (sum) as a third metric alongside events and bytes. Statsengine snapshots expose TotalLatencyNs to support this. - AttachAll takes an optional warn callback. Production passes one so older kernels that lack newer tracepoints log a warning and keep going instead of aborting startup. - Dockerfile.el8 + scripts/build-with-docker-el8.sh + mage buildDockerEl8 produce ior.el8, a static binary built against Rocky Linux 8 glibc for RHEL/Rocky/Alma 8 hosts. - README.md documents installing mage and the new el8 target.
2026-03-13feat: add tui parquet recording controlsPaul Buetow
2026-03-10dashboard: centralize nil snapshot fallback (task 385)Paul Buetow
2026-03-10dashboard: unify viewport chrome calculation (task 388)Paul Buetow
2026-03-10dashboard: unify offset reanchoring helper (task 394)Paul Buetow
2026-03-09tui: add reverse sorting for dashboard tables (task 364)Paul Buetow
2026-03-09tui: export filtered stream rows from global CSV action (task 364)Paul Buetow
2026-03-09tui: add sortable processes dashboard table (task 365)Paul Buetow
2026-03-09tui: add sortable files dashboard table modes (task 364)Paul Buetow
2026-03-09tui: add sortable syscalls dashboard table (task 363)Paul Buetow
2026-03-09tui: harden paused flame renderingPaul Buetow
2026-03-08tui: unify table navigation and renderingPaul Buetow
2026-03-08tui: add process-tab enter filter pushPaul Buetow
2026-03-08tui: restore global filter stack and anchored matchesPaul Buetow
2026-03-08task 375: show active global filter in dashboard helpPaul Buetow
2026-03-08task 374: remove stream-local filter stackPaul Buetow
2026-03-08task 372: restart tracing when filters changePaul Buetow
2026-03-08dashboard: clamp icicle selection by rendered tile countPaul Buetow
2026-03-08dashboard: split update and key routing responsibilitiesPaul Buetow
2026-03-08dashboard: wire files icicle mode and root path labelsPaul Buetow
2026-03-06fix(tui): restore bubble modes and stabilize flame zoom lineagePaul Buetow
2026-03-06feat(tui): add flamegraph click lineage undo and scope quit keyPaul Buetow
2026-03-06feat(tui): use treemap as second viz for files and processesPaul Buetow
2026-03-06feat(tui): add files icicle visualization mode (task 383)Paul Buetow
2026-03-06feat(tui): add syscalls treemap visualization mode (task 383)Paul Buetow
2026-03-06refactor(tui): add dashboard viz mode registry (task 382)Paul Buetow
2026-03-06feat(tui): add dashboard bubble viz and expand help shortcutsPaul Buetow
2026-03-06refactor: use interfaces for TUI runtime binding sources (task 382)Paul Buetow
2026-03-06flamegraph: use full viewport with capped bar height and preserve footer/statusPaul Buetow
2026-03-06Add live flamegraph test modes and dynamic synthetic live feedPaul Buetow
2026-03-06Fix flamegraph navigation, filtering, and system-share feedbackPaul Buetow
2026-03-06Start flame ticks on dashboard entry and use purple selectionPaul Buetow
2026-03-05Normalize Go import grouping with local ior sectionPaul Buetow
2026-03-05Make flame tab default and fix flame hotkey routingPaul Buetow
2026-03-05task 363: animate flamegraph data refresh transitionsPaul Buetow