pub enum ThreadLookup {
Found {
allocated_bytes: u64,
deallocated_bytes: Option<u64>,
},
MissingAllocatedBytes,
TidAbsent,
ExceedsCap,
}Expand description
Outcome of scanning the flat metric list for a tid-keyed thread
entry. Distinguishes “tid not present” from “tid present but
allocated_bytes missing” AND from “probe emitted more than
MAX_SCAN_INDEX contiguous threads without the caller’s
tid appearing in the prefix” — so a caller can issue a precise
diagnostic instead of a blanket “not found”.
Variants§
Found
snapshots.{snap_idx}.threads.N.Ok.tid == worker_tid and
snapshots.{snap_idx}.threads.N.Ok.allocated_bytes are both
present. Returns the observed counter plus the companion
deallocated_bytes (if emitted).
MissingAllocatedBytes
Probe emitted a snapshots.{snap_idx}.threads.N.{Ok,Err}.tid
matching worker_tid, but no
snapshots.{snap_idx}.threads.N.Ok.allocated_bytes sibling.
Either the tid was on the Err arm (.Err.tid), where the
probe hit an error on that thread and error/error_kind
replace the counter fields, or it was on the Ok arm but the
allocated_bytes sibling was absent.
TidAbsent
No snapshots.{snap_idx}.threads.N.{Ok,Err}.tid == worker_tid
entry in the flat metric list. Probe did not visit the worker
at all.
ExceedsCap
The flat metric list contained at least MAX_SCAN_INDEX
contiguous snapshots.{snap_idx}.threads.N.{Ok,Err}.tid
entries, none of which matched worker_tid, and the scan hit
the cap
before reaching the array terminator. The worker’s tid may
exist at a later index and be invisible to the scan.
Distinct from TidAbsent — this outcome means the lookup is
inconclusive, not that the probe definitively skipped the
worker.
Auto Trait Implementations§
impl Freeze for ThreadLookup
impl RefUnwindSafe for ThreadLookup
impl Send for ThreadLookup
impl Sync for ThreadLookup
impl Unpin for ThreadLookup
impl UnwindSafe for ThreadLookup
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
§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