pub struct QueueGauge { /* private fields */ }Expand description
Implementations§
Source§impl QueueGauge
impl QueueGauge
Sourcepub fn name(&self) -> TrackedLimit
pub fn name(&self) -> TrackedLimit
Stable limit name (used in logs and snapshots).
Sourcepub fn category(&self) -> LimitCategory
pub fn category(&self) -> LimitCategory
The class of bounded resource this gauge tracks.
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Configured queue capacity (slots). 0 means unbounded / untracked.
Sourcepub fn high_water(&self) -> usize
pub fn high_water(&self) -> usize
Highest depth observed over the gauge’s lifetime.
Sourcepub fn observe_depth(&self, depth: usize)
pub fn observe_depth(&self, depth: usize)
Report the queue’s exact current depth (for queues whose backing channel
exposes its live length, e.g. a Tokio mpsc via max_capacity - capacity).
Sourcepub fn record_enqueue(&self)
pub fn record_enqueue(&self)
Account for one item entering the queue (for manually-tracked queues).
Sourcepub fn record_dequeue(&self)
pub fn record_dequeue(&self)
Account for one item leaving the queue. Saturates at zero so a stray dequeue can never underflow the depth counter. Re-evaluates so a gauge that latched “warned” while full re-arms once the queue drains back below the re-arm threshold, even if the producer has since gone idle.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for QueueGauge
impl RefUnwindSafe for QueueGauge
impl Send for QueueGauge
impl Sync for QueueGauge
impl Unpin for QueueGauge
impl UnsafeUnpin for QueueGauge
impl UnwindSafe for QueueGauge
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