blob: 463268f3ca9d8a9d193d18b565561cfae693aee2 (
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
26
27
28
29
30
31
32
33
34
|
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
}
// DiskStamp holds disk I/O stats and timestamp for delta calculation.
type DiskStamp struct {
SectorsRead int64
SectorsWrite int64
IoTicks 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
Disk map[string]DiskStamp
}
// Source is the interface the display uses to read current stats.
type Source interface {
Snapshot() map[string]*HostStats
}
|