#[non_exhaustive]pub struct ScxEventsView<'a> { /* private fields */ }Expand description
Borrowed view over the ScxEventDeltas aggregated across the
monitor’s first/last sample window. Returned by
MonitorView::scx_events; exposes the 14 i64 counter totals
via Self::total_pairs and the 2 f64 derived rates via
Self::rates_pairs.
Implementations§
Source§impl<'a> ScxEventsView<'a>
impl<'a> ScxEventsView<'a>
Sourcepub fn total_pairs(&self) -> Vec<(&'static str, i64)>
pub fn total_pairs(&self) -> Vec<(&'static str, i64)>
All 14 i64 counter totals as (name, value) pairs in the
shape that feeds
crate::assert::assert_scx_events_clean. Order:
select_cpu_fallback, select_cpu_fallback_max_burst,
dispatch_local_dsq_offline, dispatch_keep_last,
enq_skip_exiting, enq_skip_migration_disabled,
reenq_immed, reenq_local_repeat, refill_slice_dfl,
bypass_duration_ns, bypass_dispatch, bypass_activate,
insert_not_owned, sub_bypass_dispatch.
STRICTNESS WARNING: assert_scx_events_clean(pairs, None) against the full 14-entry slice will spuriously
fail under normal scheduling load — several counters
(bypass_*, dispatch_keep_last, refill_slice_dfl)
legitimately fire on healthy schedulers. Callers either
curate the slice (pairs.iter().filter(...).collect())
or pass Some(bound) for non-error-class events. The
projector deliberately does NOT bake “error class” judgment
in — different test scenarios consider different counters
error-class.
Example — assert only error-class counters are zero by curating the slice before the assertion:
if let Some(view) = series.monitor()
&& let Some(events) = view.scx_events()
{
let pairs = events.total_pairs();
let error_only: Vec<(&str, i64)> = pairs
.into_iter()
.filter(|(name, _)| ERROR_CLASS_NAMES.contains(name))
.collect();
assert!(assert_scx_events_clean(&error_only, None).is_pass());
}Sourcepub fn rates_pairs(&self) -> Vec<(&'static str, f64)>
pub fn rates_pairs(&self) -> Vec<(&'static str, f64)>
Derived per-second rate fields as (name, value) pairs.
Separate from Self::total_pairs because rates have a
different semantic (rate-bounded asserts, not count-bounded)
and a different value type (f64 vs i64). Order:
select_cpu_fallback_rate, dispatch_keep_last_rate.
Trait Implementations§
Source§impl<'a> Clone for ScxEventsView<'a>
impl<'a> Clone for ScxEventsView<'a>
Source§fn clone(&self) -> ScxEventsView<'a>
fn clone(&self) -> ScxEventsView<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for ScxEventsView<'a>
impl<'a> Debug for ScxEventsView<'a>
impl<'a> Copy for ScxEventsView<'a>
Auto Trait Implementations§
impl<'a> Freeze for ScxEventsView<'a>
impl<'a> RefUnwindSafe for ScxEventsView<'a>
impl<'a> Send for ScxEventsView<'a>
impl<'a> Sync for ScxEventsView<'a>
impl<'a> Unpin for ScxEventsView<'a>
impl<'a> UnwindSafe for ScxEventsView<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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