Documentation
¶
Overview ¶
Package sysstat samples host metrics (CPU, memory, swap, disk, network) from /proc on Linux. On platforms without /proc (e.g. local dev on macOS) the readers fail softly and return zeros — the panel still runs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Sampler ¶
type Sampler struct {
// contains filtered or unexported fields
}
Sampler maintains rolling CPU% and network rates via a background ticker.
type Stats ¶
type Stats struct {
CPUPercent float64 `json:"cpu_percent"`
MemUsed int64 `json:"mem_used"`
MemTotal int64 `json:"mem_total"`
SwapUsed int64 `json:"swap_used"`
SwapTotal int64 `json:"swap_total"`
DiskUsed int64 `json:"disk_used"`
DiskTotal int64 `json:"disk_total"`
HostUptime int64 `json:"host_uptime"` // seconds
NetUp int64 `json:"net_up"` // bytes/sec
NetDown int64 `json:"net_down"` // bytes/sec
}
Stats is a point-in-time host snapshot. Byte fields are absolute; Net* are per-second rates.
Click to show internal directories.
Click to hide internal directories.