pub struct ProtocolMetrics { /* private fields */ }Expand description
Protocol metrics for observability
Implementations§
Source§impl ProtocolMetrics
impl ProtocolMetrics
Sourcepub fn record_connection_start(&self)
pub fn record_connection_start(&self)
Record connection start
Sourcepub fn record_message_sent(&self, bytes: u64)
pub fn record_message_sent(&self, bytes: u64)
Record message sent
Sourcepub fn record_message_failed(&self)
pub fn record_message_failed(&self)
Record message failed
Sourcepub fn record_bytes_received(&self, bytes: u64)
pub fn record_bytes_received(&self, bytes: u64)
Record bytes received
Sourcepub fn record_compression(&self, uncompressed: u64, compressed: u64)
pub fn record_compression(&self, uncompressed: u64, compressed: u64)
Record compression ratio (uncompressed -> compressed)
Sourcepub fn record_latency(&self, latency: Duration)
pub fn record_latency(&self, latency: Duration)
Record message latency (one-way)
Sourcepub fn record_roundtrip(&self, roundtrip: Duration)
pub fn record_roundtrip(&self, roundtrip: Duration)
Record command roundtrip time
Sourcepub fn snapshot(&self) -> MetricsSnapshot
pub fn snapshot(&self) -> MetricsSnapshot
Get current metrics snapshot
Trait Implementations§
Source§impl Debug for ProtocolMetrics
impl Debug for ProtocolMetrics
Source§impl Default for ProtocolMetrics
impl Default for ProtocolMetrics
Source§fn default() -> ProtocolMetrics
fn default() -> ProtocolMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ProtocolMetrics
impl RefUnwindSafe for ProtocolMetrics
impl Send for ProtocolMetrics
impl Sync for ProtocolMetrics
impl Unpin for ProtocolMetrics
impl UnsafeUnpin for ProtocolMetrics
impl UnwindSafe for ProtocolMetrics
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