summaryrefslogtreecommitdiff
path: root/internal/stats/stats.go
blob: ebb81b36624dec414edbd3aaee5d79d29b9dcf79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package stats

import (
	"codeberg.org/snonux/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
}