pub struct SchedSample {
pub nr_switches: u64,
pub sum_exec_runtime_ns: u64,
pub captured_at: Instant,
}Expand description
Snapshot of the two scheduler counters this monitor watches.
Mirrors what kernel/sched/debug.c::proc_sched_show_task
writes to /proc/<pid>/sched. Both fields are cumulative since task
creation; the monitor tracks deltas between consecutive
samples rather than absolute values.
Fields§
§nr_switches: u64nr_switches from /proc/<pid>/sched — total voluntary +
involuntary context switches involving this task.
sum_exec_runtime_ns: u64sum_exec_runtime from /proc/<pid>/sched — cumulative
on-CPU runtime in nanoseconds.
captured_at: InstantInstant the sample was captured. Stored alongside the
counters so a downstream consumer can compute wall-clock
deltas without re-deriving the poll cadence. Not serialized
— Instant is a monotonic-clock opaque value with no portable
wire form; serde consumers reading a sidecar dump will see
Instant::now() as the default. The wall-clock context for
the report is carried separately by StallReport::captured_at
(also #[serde(skip)] for the same reason; sidecar dump
consumers anchoring across runs should pair the report with
the run’s start timestamp from elsewhere).
Trait Implementations§
Source§impl Clone for SchedSample
impl Clone for SchedSample
Source§fn clone(&self) -> SchedSample
fn clone(&self) -> SchedSample
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SchedSample
impl Debug for SchedSample
Source§impl<'de> Deserialize<'de> for SchedSample
impl<'de> Deserialize<'de> for SchedSample
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SchedSample
impl PartialEq for SchedSample
Source§impl Serialize for SchedSample
impl Serialize for SchedSample
impl Copy for SchedSample
impl Eq for SchedSample
impl StructuralPartialEq for SchedSample
Auto Trait Implementations§
impl Freeze for SchedSample
impl RefUnwindSafe for SchedSample
impl Send for SchedSample
impl Sync for SchedSample
impl Unpin for SchedSample
impl UnwindSafe for SchedSample
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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