diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-14 17:29:08 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-14 17:29:08 +0200 |
| commit | b1f0ce01fb6ece8628cf0499690a003cdac28f7f (patch) | |
| tree | ce67d7633075743cd057031c21dca81834494be8 /AGENTS.md | |
| parent | ef236805d7c7f655ef22da08d708ecb85212c15c (diff) | |
Remove macOS stats gathering support, require Linux with /procv0.8.4
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.
Diffstat (limited to 'AGENTS.md')
| -rw-r--r-- | AGENTS.md | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -66,33 +66,27 @@ Network interface: chosen by `netint` config or first non-`lo`; press `n` to cyc - `go test ./...` or `mage test`. No UI tests; collector has parse tests for protocol (e.g. `ParseNetLine` for Linux-style `/proc/net/dev` output). -## macOS support +## macOS support (client only) -Loadbars supports macOS with automatic window activation and OS-specific monitoring scripts. +Loadbars supports macOS as a client to monitor remote Linux servers via SSH. ### Implementation details -- **Script embedding:** Both Linux and Darwin monitoring scripts are embedded in the binary -- **OS detection:** Automatically uses the correct script based on the host: - - `localhost` on macOS → Darwin script (sysctl, vm_stat, netstat, iostat) - - `localhost` on Linux → Linux script (/proc filesystem) - - All remote hosts → Linux script (assumes remote servers are Linux) - **Window activation:** macOS-specific code automatically brings SDL window to foreground - Uses build tags (`activate_darwin.go` and `activate.go`) - No external helper script needed ### Key files -- `internal/collector/script.go` - Embeds both scripts -- `internal/collector/collector.go` - Selects script based on host (checks if `/proc` exists for localhost) +- `internal/collector/script.go` - Embeds the Linux monitoring script +- `internal/collector/collector.go` - Runs Linux script locally or over SSH; exits with error if local system lacks /proc - `internal/display/activate_darwin.go` - macOS-specific activation using `open -a` - `internal/display/activate.go` - No-op for other platforms ### Known limitations -- Remote macOS hosts are not supported (assumes all remote hosts are Linux) -- macOS script doesn't provide per-core CPU statistics (iostat limitation) -- Swap usage on macOS always shows 0 (macOS uses compressed memory differently) +- Local monitoring on macOS is not supported (requires Linux with /proc filesystem) +- All remote hosts must be Linux (assumes all remote hosts are Linux) ## Useful references |
