Documentation
¶
Overview ¶
Package procstat reads and compares two readings of a Linux /proc/stat: how busy the CPUs were between them, and which are the idlest. It is the one home of that arithmetic, shared by cmd/hostload (which reports it) and cmd/abbench (which refuses to start a round on a loaded host).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Snapshot ¶
Snapshot is a whole /proc/stat: the aggregate "cpu" line and each "cpuN".
type Times ¶
type Times struct {
User, Nice, System, Idle, IOWait, IRQ, SoftIRQ, Steal uint64
}
Times is one line of /proc/stat in clock ticks: user, nice, system, idle, iowait, irq, softirq, steal (guest time is already inside user and nice, so it is not added again).
type Usage ¶
type Usage struct {
Busy, User, Nice, System, IOWait, Steal float64
}
Usage is what happened between two snapshots of one line, as fractions of the elapsed ticks. Busy counts everything but idle and iowait: a CPU waiting on I/O is free to run a benchmark. Steal is reported apart because on a virtual machine it is time the host gave to someone else.