pub struct ThreadDeltas {
pub threads: Vec<ThreadDelta>,
pub exited: Vec<ThreadSample>,
}Expand description
Per-thread change between two snapshots (see thread_deltas).
Fields§
§threads: Vec<ThreadDelta>Threads present in the second snapshot, most wake-ups first (unknown counts last, ties by thread id).
exited: Vec<ThreadSample>Threads in the first snapshot that were gone by the second (as they were at the first). Their wake-ups inside the window are unknowable; that is a normal outcome, not an error.
Implementations§
Source§impl ThreadDeltas
impl ThreadDeltas
Sourcepub fn total_wakeups(&self) -> Option<u64>
pub fn total_wakeups(&self) -> Option<u64>
Sum of the listed threads’ wake-ups; None when any is unknown. Minus the exited threads’
counts at the first snapshot (ThreadDeltas::exited_wakeups_at_start) it equals the
whole-process wake-up delta between the same two snapshots.
Sourcepub fn exited_wakeups_at_start(&self) -> Option<u64>
pub fn exited_wakeups_at_start(&self) -> Option<u64>
Sum of the exited threads’ wake-up counters at the first snapshot; None when unknown.
Sourcepub fn top(&self, n: usize) -> &[ThreadDelta]
pub fn top(&self, n: usize) -> &[ThreadDelta]
The n threads with the most wake-ups.
Sourcepub fn result_lines(&self, elapsed: Duration, top: usize) -> String
pub fn result_lines(&self, elapsed: Duration, top: usize) -> String
Evidence lines for the top top threads over a window of elapsed, in the
RESULT <key> ... style: one RESULT thread_wakeups_summary ... line, then one
RESULT thread_wakeups rank=.. tid=.. wakeups=.. per_second=.. cpu_ms=.. born=0|1 start=0x.. name=".." line per thread with a non-zero or unknown delta. Neither key is
budget, so the runtime-budget gate (which reads only the RESULT budget line) ignores them.