summaryrefslogtreecommitdiff
path: root/internal/tui/flamegraph/model_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-26 22:31:40 +0300
committerPaul Buetow <paul@buetow.org>2026-05-26 22:31:40 +0300
commit6bfa0031cc7c903c16baaca2d0f504be26fb828c (patch)
tree0d3c002eaed4c6e02f12cbffd7054bd07989e0fe /internal/tui/flamegraph/model_test.go
parentf42d4f4f0b9d3faf38d2f3c3a9753a03440cdd24 (diff)
flamegraph: add LiveTrie height metric ingestion (task qo)
Diffstat (limited to 'internal/tui/flamegraph/model_test.go')
-rw-r--r--internal/tui/flamegraph/model_test.go24
1 files changed, 12 insertions, 12 deletions
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)