Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CPUer ¶
type CPUer interface { // The total amount of time units spent in CPU since last boot. TotalCPU() int // The total amount of time units spent since last boot. Total() int }
CPUer represents the time units spent since last boot and the ones spent in CPU tasks. This two values allows to calculate CPU usage percentages.
type S ¶
type S struct { // Time spent in user mode. User int // Time spent in user mode with low priority. Nice int // Time spent in system mode. System int // Time spent in the idle task. Idle int // Time waiting for I/O to complete. IOWait int // Time servicing interrupts. IRQ int // Time servicing soft interrupts. SoftIRQ int // Stolen time (time spent in other OS when running in a virtualized // environment. Steal int // Time spent running virtual CPU for guest OSs under the control of // the kernel. Guest int // Time spent running a niced guest. NiceGuest int }
S values contain the amount of time spent by the CPU in different states, measured in USER_HZ (1/100 secs in most systems).
This assumes Linux > 2.6.33.
Click to show internal directories.
Click to hide internal directories.