diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-13 22:52:46 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-13 22:52:46 +0200 |
| commit | cd5a3614baab756a41d764b79308afeea93f12dd (patch) | |
| tree | efc8c31e8b162ca2121ba92c841322119e6d3b04 /internal/stats | |
| parent | bf7c6ade292a6444877797c8d699d147aceb57cc (diff) | |
Remove Perl version and build files; add .gitignore for .serena/
Amp-Thread-ID: https://ampcode.com/threads/T-019c58b3-06fb-733d-8fc1-f268fe7f70d5
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/stats')
| -rw-r--r-- | internal/stats/stats.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/stats/stats.go b/internal/stats/stats.go new file mode 100644 index 0000000..b78f2f7 --- /dev/null +++ b/internal/stats/stats.go @@ -0,0 +1,25 @@ +package stats + +import ( + "github.com/loadbars/loadbars/internal/collector" +) + +// NetStamp holds network stats and timestamp for delta calculation. +type NetStamp struct { + B int64 + Tb int64 + Stamp float64 +} + +// HostStats holds the latest stats for one host (read-only snapshot). +type HostStats struct { + LoadAvg1, LoadAvg5, LoadAvg15 string + Mem map[string]int64 + Net map[string]NetStamp + CPU map[string]collector.CPULine +} + +// Source is the interface the display uses to read current stats. +type Source interface { + Snapshot() map[string]*HostStats +} |
