diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-18 09:19:03 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-18 09:19:03 +0200 |
| commit | d845cf3208c3bbdb7e3dd3041d1ae491b88d4d21 (patch) | |
| tree | 5fa93b7787a1f1c9598aecfc772ede6dbac17f8d /internal/display/display_test.go | |
| parent | 88f4e239a7521112a4db8c7842e3a05db4446cd4 (diff) | |
feat: add load average bar visualization (4/l hotkey)0.12.0
Adds a new teal bar type showing /proc/loadavg data per host.
The 1-min average fills from the top downward; yellow and white
1px reference lines mark the 5-min and 15-min averages. A global
loadPeak tracker (floor 2.0, slow per-frame decay) keeps the scale
meaningful across hosts and after spikes. Toggle with 4 or l;
persisted to ~/.loadbarsrc as showload=1.
Bump version to 0.12.0.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/display/display_test.go')
| -rw-r--r-- | internal/display/display_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/display/display_test.go b/internal/display/display_test.go index b51e6d1..7d3e82e 100644 --- a/internal/display/display_test.go +++ b/internal/display/display_test.go @@ -397,7 +397,7 @@ func TestMultiHost_BarCount(t *testing.T) { } snap := src.Snapshot() - numBars := countBars(snap, constants.CPUModeAverage, true, true) + numBars := countBars(snap, constants.CPUModeAverage, true, true, false) if numBars != 6 { t.Fatalf("expected 6 bars (2 hosts × 3), got %d", numBars) } @@ -430,19 +430,19 @@ func TestCores_Toggle(t *testing.T) { snap := map[string]*stats.HostStats{"host1": hostStats} // CPUModeAverage: aggregate bar only (1 bar) - nAverage := countBars(snap, constants.CPUModeAverage, false, false) + nAverage := countBars(snap, constants.CPUModeAverage, false, false, false) if nAverage != 1 { t.Errorf("CPUModeAverage: expected 1 bar, got %d", nAverage) } // CPUModeCores: aggregate + individual cores = cpu + cpu0 + cpu1 (3 bars) - nCores := countBars(snap, constants.CPUModeCores, false, false) + nCores := countBars(snap, constants.CPUModeCores, false, false, false) if nCores != 3 { t.Errorf("CPUModeCores: expected 3 bars, got %d", nCores) } // CPUModeOff: no CPU bars → countBars floors to 1 (window always shows something) - nOff := countBars(snap, constants.CPUModeOff, false, false) + nOff := countBars(snap, constants.CPUModeOff, false, false, false) if nOff != 1 { t.Errorf("CPUModeOff: expected 1 (floor), got %d", nOff) } @@ -700,7 +700,7 @@ func TestHandleKey_ToggleCores(t *testing.T) { } // State 2 (CPUModeOff): no CPU bars; countBars returns 1 (floor) so window is still drawn - nOff := countBars(src.Snapshot(), constants.CPUModeOff, false, false) + nOff := countBars(src.Snapshot(), constants.CPUModeOff, false, false, false) if nOff != 1 { t.Errorf("CPUModeOff: expected countBars=1 (floor), got %d", nOff) } |
