pub struct QueueGuardrails { /* private fields */ }Expand description
Queue depth tracker.
Monitors the number of pending frames and produces alerts when configured thresholds are exceeded.
Implementations§
Source§impl QueueGuardrails
impl QueueGuardrails
Sourcepub fn new(config: QueueConfig) -> Self
pub fn new(config: QueueConfig) -> Self
Create a new queue guardrail with the given configuration.
Sourcepub fn check(
&mut self,
current_depth: u32,
) -> (Option<GuardrailAlert>, QueueAction)
pub fn check( &mut self, current_depth: u32, ) -> (Option<GuardrailAlert>, QueueAction)
Report current queue depth and get an alert if thresholds are exceeded.
Returns (alert, action) where action indicates what the runtime should
do about queued frames (if anything).
Sourcepub fn current_depth(&self) -> u32
pub fn current_depth(&self) -> u32
Current queue depth.
Sourcepub fn peak_depth(&self) -> u32
pub fn peak_depth(&self) -> u32
Peak queue depth observed.
Sourcepub fn total_drops(&self) -> u64
pub fn total_drops(&self) -> u64
Total frames dropped due to queue overflow.
Sourcepub fn total_backpressure_events(&self) -> u64
pub fn total_backpressure_events(&self) -> u64
Total backpressure events.
Sourcepub fn config(&self) -> &QueueConfig
pub fn config(&self) -> &QueueConfig
Get a reference to the configuration.
Trait Implementations§
Source§impl Clone for QueueGuardrails
impl Clone for QueueGuardrails
Source§fn clone(&self) -> QueueGuardrails
fn clone(&self) -> QueueGuardrails
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QueueGuardrails
impl RefUnwindSafe for QueueGuardrails
impl Send for QueueGuardrails
impl Sync for QueueGuardrails
impl Unpin for QueueGuardrails
impl UnsafeUnpin for QueueGuardrails
impl UnwindSafe for QueueGuardrails
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