| Age | Commit message (Collapse) | Author |
|
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
Split 22 production files across the codebase — event loop, TUI models,
probe manager, dashboard, export, flag parsing, code generation, and
ioworkload scenarios — so that no function body exceeds 50 lines. Each
extracted helper carries its own comment explaining its role.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
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>
|
|
Four near-identical sorted-rows functions (sortedFileSnapshots,
sortedDirSnapshots, sortedSyscallSnapshots, sortedProcessTableRows)
each repeated the same guard-clone-sort-tiebreak-apply pattern.
Replace them with a single generic sortedWithState[T,K] in sort.go
that accepts per-tab byKey and tiebreak comparators as parameters.
Remove now-unused slices imports from syscalls.go and processes.go.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
fileRankHeap Len/Less/Swap converted to pointer receivers to match
Push/Pop; bubbleChart HasNodes and AnimationState Settled converted
to pointer receivers to match all other methods on their types.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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'.
|
|
- 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|