pub struct ReadMetrics {
pub count: u64,
pub backlog: Option<u64>,
pub pending: Option<Microseconds>,
pub rate: Option<f64>,
}Expand description
Metrics for reading from a topic (subscription/consumer).
Fields§
§count: u64Number of messages successfully read.
backlog: Option<u64>Number of messages waiting to be read (backlog/lag).
pending: Option<Microseconds>How long the consumer has been waiting for a message.
If set, indicates the consumer is blocked waiting for messages. This helps identify slow producers or idle consumers.
rate: Option<f64>Messages read per second (computed over a window).
Implementations§
Source§impl ReadMetrics
impl ReadMetrics
Sourcepub fn builder() -> ReadMetricsBuilder
pub fn builder() -> ReadMetricsBuilder
Create a builder for read metrics.
Sourcepub fn is_healthy(&self, max_backlog: u64, max_pending: Microseconds) -> bool
pub fn is_healthy(&self, max_backlog: u64, max_pending: Microseconds) -> bool
Check if this read stream appears healthy.
Returns false if there’s a significant backlog or long pending time.
Trait Implementations§
Source§impl Clone for ReadMetrics
impl Clone for ReadMetrics
Source§fn clone(&self) -> ReadMetrics
fn clone(&self) -> ReadMetrics
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 moreSource§impl Debug for ReadMetrics
impl Debug for ReadMetrics
Source§impl Default for ReadMetrics
impl Default for ReadMetrics
Source§fn default() -> ReadMetrics
fn default() -> ReadMetrics
Returns the “default value” for a type. Read more
Source§impl PartialEq for ReadMetrics
impl PartialEq for ReadMetrics
impl StructuralPartialEq for ReadMetrics
Auto Trait Implementations§
impl Freeze for ReadMetrics
impl RefUnwindSafe for ReadMetrics
impl Send for ReadMetrics
impl Sync for ReadMetrics
impl Unpin for ReadMetrics
impl UnwindSafe for ReadMetrics
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