summaryrefslogtreecommitdiff
path: root/internal/tui/flamegraph/controls.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-27 08:21:33 +0300
committerPaul Buetow <paul@buetow.org>2026-05-27 08:21:33 +0300
commit44fa9635c64477fe2e5a1205dd68e82c7c6b6ce9 (patch)
tree199096ffbbfce56dffb8b4ada609a4822b5099ff /internal/tui/flamegraph/controls.go
parent4365542fc8c08f7ce11040fa62a94a78fba1c2e2 (diff)
flamegraph: show selected height metric in status line (zo)
Diffstat (limited to 'internal/tui/flamegraph/controls.go')
-rw-r--r--internal/tui/flamegraph/controls.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/internal/tui/flamegraph/controls.go b/internal/tui/flamegraph/controls.go
index c9e5484..7eee102 100644
--- a/internal/tui/flamegraph/controls.go
+++ b/internal/tui/flamegraph/controls.go
@@ -156,7 +156,7 @@ func (m Model) selectionStatusLine() string {
mode = "PAUSED"
}
heightLabel := ""
- if m.heightField != "" {
+ if m.heightMetricActive() {
heightLabel = " | height:" + m.heightFieldLabel()
}
if len(m.frames) == 0 {
@@ -168,6 +168,16 @@ func (m Model) selectionStatusLine() string {
selIdx = 0
}
frame := m.frames[selIdx]
+ if m.heightMetricActive() {
+ maxHeightTotal := uint64(0)
+ for i := range m.frames {
+ if m.frames[i].HeightTotal > maxHeightTotal {
+ maxHeightTotal = m.frames[i].HeightTotal
+ }
+ }
+ heightShare := percentOfTotal(frame.HeightTotal, maxHeightTotal)
+ heightLabel = fmt.Sprintf(" | height(%s)=%d (%.1f%% of max)", m.heightFieldLabel(), frame.HeightTotal, heightShare)
+ }
systemShare := frame.Percent
if m.globalTotal > 0 {
systemShare = percentOfTotal(frame.Total, m.globalTotal)