Struct procfs::CpuTime [−][src]
pub struct CpuTime {
pub user: u64,
pub nice: u64,
pub system: u64,
pub idle: u64,
pub iowait: Option<u64>,
pub irq: Option<u64>,
pub softirq: Option<u64>,
pub steal: Option<u64>,
pub guest: Option<u64>,
pub guest_nice: Option<u64>,
// some fields omitted
}
Expand description
The amount of time, measured in ticks, the CPU has been in specific states
These fields are measured in ticks because the underlying data from the kernel is measured in ticks.
The number of ticks per second can be returned by ticks_per_second()
and is generally 100 on most systems.
To convert this value to seconds, you can divide by the tps. There are also convenience methods
that you can use too.
Fields
user: u64
Ticks spent in user mode
nice: u64
Ticks spent in user mode with low priority (nice)
system: u64
Ticks spent in system mode
idle: u64
Ticks spent in the idle state
iowait: Option<u64>
Ticks waiting for I/O to complete
This value is not reliable, for the following reasons:
-
The CPU will not wait for I/O to complete; iowait is the time that a task is waiting for I/O to complete. When a CPU goes into idle state for outstanding task I/O, another task will be scheduled on this CPU.
-
On a multi-core CPU, this task waiting for I/O to complete is not running on any CPU, so the iowait for each CPU is difficult to calculate.
-
The value in this field may decrease in certain conditions.
(Since Linux 2.5.41)
irq: Option<u64>
Ticks servicing interrupts
(Since Linux 2.6.0)
softirq: Option<u64>
Ticks servicing softirqs
(Since Linux 2.6.0)
steal: Option<u64>
Ticks of stolen time.
Stolen time is the time spent in other operating systems when running in a virtualized environment.
(Since Linux 2.6.11)
guest: Option<u64>
Ticks spent running a virtual CPU for guest operating systems under control of the linux kernel
(Since Linux 2.6.24)
guest_nice: Option<u64>
Ticks spent running a niced guest
(Since Linux 2.6.33)
Implementations
Time spent in user mode
Time spent in user mode with low priority (nice)
Time spent in system mode
Time spent in the idle state
Time spent waiting for I/O to complete
Time spent servicing interrupts
Milliseconds spent servicing softirqs
Time spent servicing softirqs
Amount of stolen time
Milliseconds spent running a virtual CPU for guest operating systems under control of the linux kernel
Time spent running a virtual CPU for guest operating systems under control of the linux kernel
Milliseconds spent running a niced guest
Time spent running a niced guest
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CpuTime
impl UnwindSafe for CpuTime
Blanket Implementations
Mutably borrows from an owned value. Read more