pub struct StatsPathProjector<'a> { /* private fields */ }Expand description
Auto-projector handle returned by SampleSeries::stats_path.
Walks a stats sub-tree per sample and exposes scalar / nested
projections for the keys at that level.
Implementations§
Source§impl<'a> StatsPathProjector<'a>
impl<'a> StatsPathProjector<'a>
Sourcepub fn field_u64(&self, key: &str) -> SeriesField<u64>
pub fn field_u64(&self, key: &str) -> SeriesField<u64>
Project a JSON key under the resolved path as u64.
Sourcepub fn field_i64(&self, key: &str) -> SeriesField<i64>
pub fn field_i64(&self, key: &str) -> SeriesField<i64>
Project a JSON key under the resolved path as i64.
Sourcepub fn field_f64(&self, key: &str) -> SeriesField<f64>
pub fn field_f64(&self, key: &str) -> SeriesField<f64>
Project a JSON key under the resolved path as f64.
Sourcepub fn key(&self, key: &str) -> StatsPathProjector<'a>
pub fn key(&self, key: &str) -> StatsPathProjector<'a>
Return a sub-projector rooted under key. Composable —
series.stats_path("layers").key("batch").field_f64("util")
drills into the per-layer scheduler stats one segment at a
time without each call site re-typing the full dotted
path.
Sourcepub fn key_names(&self) -> Vec<String>
pub fn key_names(&self) -> Vec<String>
Discover the JSON object keys of the resolved path, unioned across ALL samples (sorted, deduplicated). Empty ONLY when no sample resolves the path to an object.
Discovery spans every row rather than sample 0 alone: a
scheduler-defined scx_stats object can be absent or Err in
sample 0 (the first capture often predates the scheduler’s first
stats emit) while later samples carry it; reading only sample 0
would silently return no keys and blind a “assert over every
scx_stats counter” blanket projection.
Sourcepub fn u64_fields(&self) -> Vec<(String, SeriesField<u64>)>
pub fn u64_fields(&self) -> Vec<(String, SeriesField<u64>)>
Project every object key that resolves as u64 for at
least one sample. Iterates Self::key_names, calls
Self::field_u64 for each, and keeps the entries whose
resulting SeriesField has at least one Ok value —
non-numeric leaves (strings, nested objects, floats) drop
out.
Sourcepub fn f64_fields(&self) -> Vec<(String, SeriesField<f64>)>
pub fn f64_fields(&self) -> Vec<(String, SeriesField<f64>)>
Project every object key that resolves as f64 for at
least one sample. Mirrors Self::u64_fields using
Self::field_f64.
Auto Trait Implementations§
impl<'a> Freeze for StatsPathProjector<'a>
impl<'a> RefUnwindSafe for StatsPathProjector<'a>
impl<'a> Send for StatsPathProjector<'a>
impl<'a> Sync for StatsPathProjector<'a>
impl<'a> Unpin for StatsPathProjector<'a>
impl<'a> UnwindSafe for StatsPathProjector<'a>
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