pub struct DelayStats {
pub cpu_delay_ns: u64,
pub blkio_delay_ns: u64,
pub swapin_delay_ns: u64,
pub elapsed_us: u64,
}Expand description
Cumulative delay counters for one task, all in nanoseconds, plus the task’s elapsed wall-clock life in microseconds.
Cumulative rather than a percentage because the caller owns the previous
sample: turning two samples into a percentage needs the interval, and a
DelayStats that stored a percentage would have to be read twice per tick.
Fields§
§cpu_delay_ns: u64Time spent runnable but not on a CPU.
blkio_delay_ns: u64Time spent waiting for synchronous block I/O.
swapin_delay_ns: u64Time spent waiting for a page to be swapped in.
elapsed_us: u64The task’s elapsed wall-clock life, in microseconds.
Implementations§
Source§impl DelayStats
impl DelayStats
Sourcepub fn total_delay_ns(self) -> u64
pub fn total_delay_ns(self) -> u64
Total time spent waiting, in nanoseconds.
Sourcepub fn cpu_percent(self) -> Option<f32>
pub fn cpu_percent(self) -> Option<f32>
Share of the task’s life spent waiting on a CPU, in percent.
None when the elapsed time is zero, which is the state of a task that
has not been sampled twice yet; a percentage of nothing is not zero.
pub fn blkio_percent(self) -> Option<f32>
pub fn swapin_percent(self) -> Option<f32>
Trait Implementations§
Source§impl Clone for DelayStats
impl Clone for DelayStats
impl Copy for DelayStats
Source§impl Debug for DelayStats
impl Debug for DelayStats
Source§impl Default for DelayStats
impl Default for DelayStats
impl Eq for DelayStats
Source§impl PartialEq for DelayStats
impl PartialEq for DelayStats
impl StructuralPartialEq for DelayStats
Auto Trait Implementations§
impl Freeze for DelayStats
impl RefUnwindSafe for DelayStats
impl Send for DelayStats
impl Sync for DelayStats
impl Unpin for DelayStats
impl UnsafeUnpin for DelayStats
impl UnwindSafe for DelayStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more