pub struct ThresholdProfiler { /* private fields */ }Expand description
ProfilingObserver variant that also fires alerts on per-node duration
thresholds. Same timing snapshot via snapshot(); thresholds are
configured per node via with_threshold(node, max_ns). On an
OnNodeEnd whose elapsed > the configured cap, every registered
callback runs (synchronously, on the observer’s thread).
Callbacks should be cheap and non-blocking — they run inline on the graph engine’s thread.
Implementations§
Source§impl ThresholdProfiler
impl ThresholdProfiler
Sourcepub fn snapshot(&self) -> HashMap<String, NodeTiming>
pub fn snapshot(&self) -> HashMap<String, NodeTiming>
Snapshot of per-node timings (same shape as ProfilingObserver).
Sourcepub fn with_threshold(self, node: impl Into<String>, max_ns: u128) -> Self
pub fn with_threshold(self, node: impl Into<String>, max_ns: u128) -> Self
Register a duration cap (in nanoseconds) for node. Subsequent
invocations that exceed max_ns will fire every registered
callback. Replaces any prior threshold for the node.
Trait Implementations§
Source§impl Default for ThresholdProfiler
impl Default for ThresholdProfiler
Auto Trait Implementations§
impl !Freeze for ThresholdProfiler
impl RefUnwindSafe for ThresholdProfiler
impl Send for ThresholdProfiler
impl Sync for ThresholdProfiler
impl Unpin for ThresholdProfiler
impl UnsafeUnpin for ThresholdProfiler
impl UnwindSafe for ThresholdProfiler
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
Mutably borrows from an owned value. Read more