| Age | Commit message (Collapse) | Author |
|
|
|
- Add M DISKSTATS block to embedded loadbars-remote.sh so disk I/O is
collected from /proc/diskstats on remote hosts (was only in scripts/ copy).
- Document in countBars that total bars are computed per host (dynamic
device count when disk mode is per-device).
- Extend r hotkey to reset disk auto-scale peak to 1 MB/s floor when disk
bars are on and diskmax is not fixed; update README and help text.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
Add a new disk stats category that reads /proc/diskstats, shows read/write
throughput as colored bars (purple/darker purple like network RX/TX), with
optional utilization % overlay in extended mode. Hotkey 5 cycles: aggregate
(sum all whole-disk devices) → per-device → off. Auto-scale with decay and
optional fixed override via --diskmax / diskmax config key.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
- config: split set() (62L) into setSizeAndTuning() + setDisplayFlags()
- collector: split Run() (70L) into Run + startLocalScanner + startRemoteScanner
+ parseCollectorStream + dispatchCollectorLine; each <30L
- collector: remove unused script_embed.go (RemoteScript was dead code)
- display: move newRunState constructor before Run() per constructor-first rule
- display: replace loadPeak IIFE with a plain initLoadPeak variable
- display: split handleKey() (114L) into handleToggleKeys + handleAdjustAndSave
+ handleResizeKeys; add nil guard in handleResizeKeys for test safety
- display: split drawNetBarSmoothed() (75L) into drawNetBarSmoothed +
smoothNetUtilization + drawNetHalves; each <30L
- all: gofmt -w to fix formatting drift in display and config files
All tests pass (go test ./...).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
CPU display now cycles through three states with each press of 1:
0 = CPUModeAverage – aggregate bar only (default)
1 = CPUModeCores – individual core bars + aggregate
2 = CPUModeOff – all CPU bars hidden
Config file stores cpumode=N (integer); old showcores=0/1 is read for
backward compatibility. CLI flag --showcores replaced by --cpumode.
Other improvements landed in this commit:
- internal/display: add font.go (text rendering), hittest.go (bar hit
testing), tooltip.go (mouse-over tooltip), tooltip_test.go
- internal/display: mouse tracking and drawOverlay hook in display.go
- internal/display: update build tags to //go:build form
- internal/collector: embed remote script via script_embed.go /
scriptdata/loadbars-remote.sh
- internal/collector: CPULine.Total() changed to value receiver
- internal/collector: table test improvements (name field, t.Run)
- internal/constants: BytesPerSec consts promoted from var to const
- Magefile.go: fix error formatting and install path
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Remove non-functional macOS monitoring code that used native tools (sysctl, vm_stat, netstat, iostat). Now loadbars exits with an error when attempting local stats gathering on non-Linux systems. macOS can still be used as a client to monitor remote Linux servers via SSH.
|
|
This commit adds full macOS support for loadbars, allowing it to run
natively on macOS for both localhost monitoring and remote Linux hosts.
Key changes:
- Embed both Linux and Darwin monitoring scripts in the binary
- Auto-detect localhost OS and use appropriate script
- Darwin script uses native macOS tools (sysctl, vm_stat, netstat, iostat)
- Remote hosts always use Linux script (assumes /proc filesystem)
- Automatic window activation on macOS using build tags
- No external helper scripts needed
The binary now works seamlessly on macOS:
- localhost monitoring uses macOS-specific commands
- Remote Linux hosts work via SSH with Linux script
- SDL window automatically comes to foreground on macOS
- Cross-platform build with single binary for all scenarios
Technical implementation:
- internal/collector/script.go: Embeds both scripts
- internal/collector/loadbars-remote-darwin.sh: macOS monitoring
- internal/collector/loadbars-remote.sh: Linux monitoring (copied from scripts/)
- internal/display/activate_darwin.go: macOS window activation
- internal/display/activate.go: No-op for other platforms
- Updated README.md with macOS installation instructions
- Added MACOS.md with detailed macOS documentation
|
|
|
|
- README: add Hotkeys section (1,2,3,e,h,n,q,w,a,y,d,c,f,v,arrows)
- README: network interface and netlink config docs
- Display: default window width 1200; clear bar slots to fix CPU/mem/net mixing
- Display: numBars count only non-nil hosts (layout matches draw)
- Display: network bars (key 3), net interface choice and n=cycle
- Display: extended peak line (e), cpu/net avg keys (a,y,d,c) with feedback
- Config: default barwidth 1200; netint/netlink in --help
- Collector: parse_test Linux-style net stats
Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
- Collector: always send all CPU lines so key 1 can toggle per-core view
- Display: use float division in drawCPUBar to avoid divide-by-zero panic
- Display: count actual CPU bars for bar width so all cores fit on screen
- Display: use local showMem/showNet for layout, add stdout feedback for 1/2/3
Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
- Module codeberg.org/snonux/loadbars, Go 1.25
- cmd/loadbars, internal/{app,config,collector,display,stats,constants,version}
- SDL display, shell script for remote (no Perl), config/cluster support
- Magefile: build, test, install, uninstall/deinstall
- NOTICE for go-sdl2 attribution (BSD-3-Clause)
- Default to localhost when no hosts given (no SSH)
- Remove loadbars-go binary name; build as loadbars
Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
Amp-Thread-ID: https://ampcode.com/threads/T-019c58b3-06fb-733d-8fc1-f268fe7f70d5
Co-authored-by: Amp <amp@ampcode.com>
|