pub struct CpuTimes {
pub cpu_id: Option<u32>,
pub user_ns: Option<u64>,
pub user_nice_ns: Option<u64>,
pub system_mode_ns: Option<u64>,
pub idle_ns: Option<u64>,
pub io_wait_ns: Option<u64>,
pub irq_ns: Option<u64>,
pub softirq_ns: Option<u64>,
}
Expand description
Times in each mode, since boot. Unit: nanoseconds.
Fields§
§cpu_id: Option<u32>
§user_ns: Option<u64>
Time spent in user mode.
user_nice_ns: Option<u64>
Time spent in user mode (low prio).
system_mode_ns: Option<u64>
Time spent in system mode.
idle_ns: Option<u64>
Time spent in the idle task.
io_wait_ns: Option<u64>
Time spent waiting for I/O.
irq_ns: Option<u64>
Time spent servicing interrupts.
softirq_ns: Option<u64>
Time spent servicing softirqs.
Implementations§
Source§impl CpuTimes
impl CpuTimes
Sourcepub fn cpu_id(&self) -> u32
pub fn cpu_id(&self) -> u32
Returns the value of cpu_id
, or the default value if cpu_id
is unset.
Sourcepub fn user_ns(&self) -> u64
pub fn user_ns(&self) -> u64
Returns the value of user_ns
, or the default value if user_ns
is unset.
Sourcepub fn user_nice_ns(&self) -> u64
pub fn user_nice_ns(&self) -> u64
Returns the value of user_nice_ns
, or the default value if user_nice_ns
is unset.
Sourcepub fn system_mode_ns(&self) -> u64
pub fn system_mode_ns(&self) -> u64
Returns the value of system_mode_ns
, or the default value if system_mode_ns
is unset.
Sourcepub fn idle_ns(&self) -> u64
pub fn idle_ns(&self) -> u64
Returns the value of idle_ns
, or the default value if idle_ns
is unset.
Sourcepub fn io_wait_ns(&self) -> u64
pub fn io_wait_ns(&self) -> u64
Returns the value of io_wait_ns
, or the default value if io_wait_ns
is unset.
Sourcepub fn irq_ns(&self) -> u64
pub fn irq_ns(&self) -> u64
Returns the value of irq_ns
, or the default value if irq_ns
is unset.
Sourcepub fn softirq_ns(&self) -> u64
pub fn softirq_ns(&self) -> u64
Returns the value of softirq_ns
, or the default value if softirq_ns
is unset.
Trait Implementations§
Source§impl Message for CpuTimes
impl Message for CpuTimes
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.