diff options
Diffstat (limited to 'internal/tui')
| -rw-r--r-- | internal/tui/dashboard/model_test.go | 10 | ||||
| -rw-r--r-- | internal/tui/flamegraph/async_refresh_test.go | 10 | ||||
| -rw-r--r-- | internal/tui/flamegraph/bench_test.go | 2 | ||||
| -rw-r--r-- | internal/tui/flamegraph/model_test.go | 24 | ||||
| -rw-r--r-- | internal/tui/flamegraph/stress_test.go | 4 | ||||
| -rw-r--r-- | internal/tui/flamegraph/testdata_test.go | 2 | ||||
| -rw-r--r-- | internal/tui/tui_test.go | 8 |
7 files changed, 30 insertions, 30 deletions
diff --git a/internal/tui/dashboard/model_test.go b/internal/tui/dashboard/model_test.go index f758597..aa54e97 100644 --- a/internal/tui/dashboard/model_test.go +++ b/internal/tui/dashboard/model_test.go @@ -845,7 +845,7 @@ func TestStreamSpaceUnpauseSchedulesStreamTick(t *testing.T) { } func TestFlameTickRefreshesFlamegraphModel(t *testing.T) { - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") liveTrie.Reset() m := NewModelWithConfig(nil, nil, 250, 200, common.DefaultKeyMap()) @@ -863,7 +863,7 @@ func TestFlameTickRefreshesFlamegraphModel(t *testing.T) { } func TestSetLiveTriePreloadsInitialSnapshotWithoutVersionChange(t *testing.T) { - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") m := NewModelWithConfig(nil, nil, 250, 200, common.DefaultKeyMap()) m.SetLiveTrie(liveTrie) @@ -880,7 +880,7 @@ func TestSetLiveTriePreloadsInitialSnapshotWithoutVersionChange(t *testing.T) { } func TestFlameTickPausedFreezesAfterInitialSnapshot(t *testing.T) { - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") m := NewModelWithConfig(nil, nil, 250, 200, common.DefaultKeyMap()) m.SetLiveTrie(liveTrie) m.activeTab = TabFlame @@ -905,7 +905,7 @@ func TestFlameTickPausedFreezesAfterInitialSnapshot(t *testing.T) { } func TestPausedFlameDashboardViewPreservesZoomedSelectedLine(t *testing.T) { - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") coreflamegraph.SeedTestFlameData(liveTrie) m := NewModelWithConfig(nil, nil, 250, 200, common.DefaultKeyMap()) @@ -1352,7 +1352,7 @@ func TestRefreshKeyResetsBaselineWhenSourceSupportsReset(t *testing.T) { } func TestRefreshKeyResetsLiveTrieOutsideFlameTab(t *testing.T) { - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") m := NewModelWithConfig(nil, nil, 250, 200, common.DefaultKeyMap()) m.SetLiveTrie(liveTrie) m.activeTab = TabSyscalls diff --git a/internal/tui/flamegraph/async_refresh_test.go b/internal/tui/flamegraph/async_refresh_test.go index d6027de..73c1889 100644 --- a/internal/tui/flamegraph/async_refresh_test.go +++ b/internal/tui/flamegraph/async_refresh_test.go @@ -31,7 +31,7 @@ func TestRefreshFromLiveTrieCmdNilWhenNoTrie(t *testing.T) { } func TestRefreshFromLiveTrieCmdProducesSnapshotReady(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") ingestTwoEventsForAsync(t, trie) m := NewModel(trie) m.width = 120 @@ -65,7 +65,7 @@ func TestRefreshFromLiveTrieCmdProducesSnapshotReady(t *testing.T) { } func TestRefreshFromLiveTrieCmdCoalescesInFlight(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") ingestTwoEventsForAsync(t, trie) m := NewModel(trie) m.width = 80 @@ -80,7 +80,7 @@ func TestRefreshFromLiveTrieCmdCoalescesInFlight(t *testing.T) { } func TestRefreshFromLiveTrieCmdSkippedWhileUserDrives(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") ingestTwoEventsForAsync(t, trie) m := NewModel(trie) m.width = 80 @@ -106,7 +106,7 @@ func TestRefreshFromLiveTrieCmdSkippedWhileUserDrives(t *testing.T) { } func TestSnapshotReadyHandlerSnapsToTargetWhileDriving(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") ingestTwoEventsForAsync(t, trie) m := NewModel(trie) m.width = 120 @@ -144,7 +144,7 @@ func TestSnapshotReadyHandlerSnapsToTargetWhileDriving(t *testing.T) { } func TestViewCacheReusesContentWhenStateUnchanged(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") ingestTwoEventsForAsync(t, trie) m := NewModel(trie) m.width = 120 diff --git a/internal/tui/flamegraph/bench_test.go b/internal/tui/flamegraph/bench_test.go index 33d77d1..d1d0955 100644 --- a/internal/tui/flamegraph/bench_test.go +++ b/internal/tui/flamegraph/bench_test.go @@ -284,7 +284,7 @@ func BenchmarkLiveTrieIngestAndSnapshot(b *testing.B) { b.Run(fmt.Sprintf("%d_events", count), func(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") for eventIdx := 0; eventIdx < count; eventIdx++ { traceID := types.SYS_ENTER_READ if eventIdx%2 == 0 { diff --git a/internal/tui/flamegraph/model_test.go b/internal/tui/flamegraph/model_test.go index e864e88..e9d16f7 100644 --- a/internal/tui/flamegraph/model_test.go +++ b/internal/tui/flamegraph/model_test.go @@ -42,7 +42,7 @@ func TestSetViewportAndDarkMode(t *testing.T) { } func TestRefreshFromLiveTrieTracksVersionAndSnapshot(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") m := NewModel(trie) if changed := m.RefreshFromLiveTrie(); !changed { @@ -58,7 +58,7 @@ func TestRefreshFromLiveTrieTracksVersionAndSnapshot(t *testing.T) { } func TestRefreshFromLiveTrieAllowsInitialLoadWhilePaused(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") m := NewModel(trie) m.paused = true @@ -74,7 +74,7 @@ func TestRefreshFromLiveTrieAllowsInitialLoadWhilePaused(t *testing.T) { } func TestRefreshFromLiveTriePausedBlocksAfterNavigableSnapshot(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") m := NewModel(trie) m.paused = true m.snapshot = &snapshotNode{Name: "root", Total: 1} @@ -94,7 +94,7 @@ func TestRefreshFromLiveTriePausedBlocksAfterNavigableSnapshot(t *testing.T) { } func TestRefreshFromLiveTriePausedBlocksAfterAnySnapshot(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") m := NewModel(trie) m.paused = true m.snapshot = &snapshotNode{Name: "root", Total: 1} @@ -441,7 +441,7 @@ func TestMouseClickDirectDeepZoomUndoReturnsToRoot(t *testing.T) { } func TestStaticFixtureArrowTraversalVisitsAllFrames(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") coreflamegraph.SeedTestFlameData(trie) m := NewModel(trie) @@ -472,7 +472,7 @@ func TestStaticFixtureArrowTraversalVisitsAllFrames(t *testing.T) { } func TestLiveFixtureArrowTraversalWhileStreamingVisitsAllFrames(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") coreflamegraph.SeedTestLiveFlameData(trie, 0) m := NewModel(trie) @@ -531,7 +531,7 @@ func TestLiveFixtureArrowTraversalWhileStreamingVisitsAllFrames(t *testing.T) { } func TestSelectionRestoresByPathAcrossLiveRefresh(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") coreflamegraph.SeedTestLiveFlameData(trie, 0) m := NewModel(trie) @@ -832,7 +832,7 @@ func TestControlPauseToggle(t *testing.T) { } func TestControlResetBaseline(t *testing.T) { - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") m := NewModel(liveTrie) m.snapshot = &snapshotNode{Name: "root", Total: 10} m.frames = []tuiFrame{{Name: "root", Path: "root"}} @@ -953,7 +953,7 @@ func TestViewFilterSelectionStatusUsesFilteredTotalAndKeepsContextVisible(t *tes } func TestControlCycleFieldOrderReconfiguresLiveTrie(t *testing.T) { - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") m := NewModel(liveTrie) initial := append([]string(nil), m.fieldPresets[m.fieldIndex]...) expectedNextIdx := (m.fieldIndex + 1) % len(m.fieldPresets) @@ -972,7 +972,7 @@ func TestControlCycleFieldOrderReconfiguresLiveTrie(t *testing.T) { } func TestControlMetricToggleReconfiguresLiveTrieCountField(t *testing.T) { - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") m := NewModel(liveTrie) m = pressFlameKey(t, m, tea.KeyPressMsg{Code: []rune{'b'}[0], Text: "b"}) @@ -1004,7 +1004,7 @@ func TestControlMetricToggleReconfiguresLiveTrieCountField(t *testing.T) { } func TestNewModelAlignsPresetIndexToLiveTrieFields(t *testing.T) { - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") m := NewModel(liveTrie) if got, want := m.fieldPresets[m.fieldIndex], []string{"comm", "path", "tracepoint"}; !reflect.DeepEqual(got, want) { t.Fatalf("expected model field preset to align with trie fields, got %v want %v", got, want) @@ -1012,7 +1012,7 @@ func TestNewModelAlignsPresetIndexToLiveTrieFields(t *testing.T) { } func TestNewModelAlignsCountFieldToLiveTrie(t *testing.T) { - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "bytes") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "bytes", "bytes") m := NewModel(liveTrie) if got, want := m.countField, "bytes"; got != want { t.Fatalf("expected model count field to align with trie field, got %q want %q", got, want) diff --git a/internal/tui/flamegraph/stress_test.go b/internal/tui/flamegraph/stress_test.go index e53e4d5..e40d4f1 100644 --- a/internal/tui/flamegraph/stress_test.go +++ b/internal/tui/flamegraph/stress_test.go @@ -26,7 +26,7 @@ func TestStressHighEventRate(t *testing.T) { ) allowedBudget := frameBudget * time.Duration(stressBudgetMultiplier()) - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") var ingestWG sync.WaitGroup type renderMetrics struct { @@ -149,7 +149,7 @@ func TestStressRapidResize(t *testing.T) { func TestStressZoomDuringRefresh(t *testing.T) { t.Parallel() - liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + liveTrie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") ingestStressEvents(liveTrie, 200, 0) model := NewModel(liveTrie) diff --git a/internal/tui/flamegraph/testdata_test.go b/internal/tui/flamegraph/testdata_test.go index c7d97b0..11fcb0c 100644 --- a/internal/tui/flamegraph/testdata_test.go +++ b/internal/tui/flamegraph/testdata_test.go @@ -29,7 +29,7 @@ const ( ) func generateTestTrie(depth, breadthPerLevel int) *coreflamegraph.LiveTrie { - lt := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + lt := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") comms := []string{"api", "db", "worker", "cache"} traceIDs := []types.TraceId{ types.SYS_ENTER_READ, diff --git a/internal/tui/tui_test.go b/internal/tui/tui_test.go index 9e62c55..d6f0740 100644 --- a/internal/tui/tui_test.go +++ b/internal/tui/tui_test.go @@ -495,7 +495,7 @@ func TestDashboardRefreshPicksLateBoundSource(t *testing.T) { func TestRuntimeBindingsStoreAndExposeLiveTrie(t *testing.T) { runtime := newRuntimeBindings() - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path"}, "count", "count") runtime.SetLiveTrie(trie) if got := runtime.liveTrie(); got != trie { t.Fatalf("expected live trie to be stored and returned") @@ -684,7 +684,7 @@ func TestGlobalFilterApplyAdvancesRuntimeFilterEpochAndKeepsRecorder(t *testing. } func TestTracingStartedUsesCurrentViewportForFlameNavigationWithoutResize(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") coreflamegraph.SeedTestFlameData(trie) m := NewModel(-1, func(context.Context) error { return nil }) @@ -727,7 +727,7 @@ func TestTracingStartedUsesCurrentViewportForFlameNavigationWithoutResize(t *tes } func TestTracingStartedAppliesViewportWhenModelSizeIsUnset(t *testing.T) { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "path", "tracepoint"}, "count", "count") coreflamegraph.SeedTestFlameData(trie) m := NewModel(-1, func(context.Context) error { return nil }) @@ -1945,7 +1945,7 @@ func aggregateTestSnapshot(syscall, path, comm, latencyLabel, gapLabel string) * } func aggregateTestTrie(comm, path string) *coreflamegraph.LiveTrie { - trie := coreflamegraph.NewLiveTrie([]string{"comm", "tracepoint", "path"}, "count") + trie := coreflamegraph.NewLiveTrie([]string{"comm", "tracepoint", "path"}, "count", "count") trie.AddRecord(coreflamegraph.IterRecord{ Comm: comm, Path: path, |
