pub struct WriteMetrics {
pub count: u64,
pub pending: Option<Microseconds>,
pub rate: Option<f64>,
}Expand description
Metrics for writing to a topic (publication/producer).
Fields§
§count: u64Number of messages successfully written.
pending: Option<Microseconds>How long the producer has been waiting to write.
If set, indicates backpressure - the topic or downstream consumers are not keeping up.
rate: Option<f64>Messages written per second (computed over a window).
Implementations§
Source§impl WriteMetrics
impl WriteMetrics
Sourcepub fn builder() -> WriteMetricsBuilder
pub fn builder() -> WriteMetricsBuilder
Create a builder for write metrics.
Sourcepub fn is_healthy(&self, max_pending: Microseconds) -> bool
pub fn is_healthy(&self, max_pending: Microseconds) -> bool
Check if this write stream appears healthy.
Returns false if there’s a long pending time (backpressure).
Trait Implementations§
Source§impl Clone for WriteMetrics
impl Clone for WriteMetrics
Source§fn clone(&self) -> WriteMetrics
fn clone(&self) -> WriteMetrics
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 WriteMetrics
impl Debug for WriteMetrics
Source§impl Default for WriteMetrics
impl Default for WriteMetrics
Source§fn default() -> WriteMetrics
fn default() -> WriteMetrics
Returns the “default value” for a type. Read more
Source§impl PartialEq for WriteMetrics
impl PartialEq for WriteMetrics
impl StructuralPartialEq for WriteMetrics
Auto Trait Implementations§
impl Freeze for WriteMetrics
impl RefUnwindSafe for WriteMetrics
impl Send for WriteMetrics
impl Sync for WriteMetrics
impl Unpin for WriteMetrics
impl UnwindSafe for WriteMetrics
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