pub struct MonitorCore { /* private fields */ }Expand description
The monitor’s shareable core: ingest on one side, events + snapshots on
the other. Session wiring lives in Monitor; the core is pure and
deterministically testable.
Implementations§
Source§impl MonitorCore
impl MonitorCore
pub fn new(capacity: usize) -> Arc<MonitorCore> ⓘ
Sourcepub fn ingest(&self, view: SampleView, sn: Option<u32>)
pub fn ingest(&self, view: SampleView, sn: Option<u32>)
Ingest one sample: stats update + broadcast. Hot path — one lock, no tree work (that happens on the tick).
pub fn node_event(&self, key: String, up: bool)
Sourcepub fn tree(&self) -> Arc<KeyTreeSnapshot> ⓘ
pub fn tree(&self) -> Arc<KeyTreeSnapshot> ⓘ
The latest immutable snapshot (lock-free pull).
Sourcepub fn with_stats<R>(&self, f: impl FnOnce(&StatsTable) -> R) -> R
pub fn with_stats<R>(&self, f: impl FnOnce(&StatsTable) -> R) -> R
Read access to the raw stats (hz/bw commands).
Sourcepub fn events(self: &Arc<Self>) -> EventStream
pub fn events(self: &Arc<Self>) -> EventStream
Subscribe to the event stream.
Auto Trait Implementations§
impl !Freeze for MonitorCore
impl !RefUnwindSafe for MonitorCore
impl !UnwindSafe for MonitorCore
impl Send for MonitorCore
impl Sync for MonitorCore
impl Unpin for MonitorCore
impl UnsafeUnpin for MonitorCore
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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