summaryrefslogtreecommitdiff
path: root/internal/stats/stats.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/stats/stats.go')
-rw-r--r--internal/stats/stats.go25
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
+}