From cd5a3614baab756a41d764b79308afeea93f12dd Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 13 Feb 2026 22:52:46 +0200 Subject: 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 --- internal/stats/stats.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 internal/stats/stats.go (limited to 'internal/stats') 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 +} -- cgit v1.2.3