pub struct ChannelMetrics { /* private fields */ }Expand description
Atomic metrics counters for thread-safe updates.
Implementations§
Source§impl ChannelMetrics
impl ChannelMetrics
Sourcepub fn record_send(&self, bytes: usize)
pub fn record_send(&self, bytes: usize)
Record a message sent.
Sourcepub fn record_recv(&self, bytes: usize)
pub fn record_recv(&self, bytes: usize)
Record a message received.
Sourcepub fn record_send_error(&self)
pub fn record_send_error(&self)
Record a send error.
Sourcepub fn record_recv_error(&self)
pub fn record_recv_error(&self)
Record a receive error.
Sourcepub fn record_latency(&self, latency: Duration)
pub fn record_latency(&self, latency: Duration)
Record latency for a message.
Sourcepub fn set_queue_depth(&self, depth: u64)
pub fn set_queue_depth(&self, depth: u64)
Update queue depth.
Sourcepub fn messages_sent(&self) -> u64
pub fn messages_sent(&self) -> u64
Get messages sent count.
Sourcepub fn messages_received(&self) -> u64
pub fn messages_received(&self) -> u64
Get messages received count.
Sourcepub fn bytes_sent(&self) -> u64
pub fn bytes_sent(&self) -> u64
Get bytes sent count.
Sourcepub fn bytes_received(&self) -> u64
pub fn bytes_received(&self) -> u64
Get bytes received count.
Sourcepub fn send_errors(&self) -> u64
pub fn send_errors(&self) -> u64
Get send errors count.
Sourcepub fn receive_errors(&self) -> u64
pub fn receive_errors(&self) -> u64
Get receive errors count.
Sourcepub fn queue_depth(&self) -> u64
pub fn queue_depth(&self) -> u64
Get current queue depth.
Sourcepub fn peak_queue_depth(&self) -> u64
pub fn peak_queue_depth(&self) -> u64
Get peak queue depth.
Sourcepub fn avg_latency_us(&self) -> u64
pub fn avg_latency_us(&self) -> u64
Get average latency in microseconds.
Sourcepub fn min_latency_us(&self) -> Option<u64>
pub fn min_latency_us(&self) -> Option<u64>
Get minimum latency in microseconds.
Sourcepub fn max_latency_us(&self) -> u64
pub fn max_latency_us(&self) -> u64
Get maximum latency in microseconds.
Sourcepub fn latency_percentile(&self, percentile: u8) -> u64
pub fn latency_percentile(&self, percentile: u8) -> u64
Get latency percentile (e.g., 99 for p99).
Sourcepub fn send_throughput(&self) -> f64
pub fn send_throughput(&self) -> f64
Get send throughput in messages per second.
Sourcepub fn recv_throughput(&self) -> f64
pub fn recv_throughput(&self) -> f64
Get receive throughput in messages per second.
Sourcepub fn send_bandwidth(&self) -> f64
pub fn send_bandwidth(&self) -> f64
Get send bandwidth in bytes per second.
Sourcepub fn recv_bandwidth(&self) -> f64
pub fn recv_bandwidth(&self) -> f64
Get receive bandwidth in bytes per second.
Sourcepub fn snapshot(&self) -> MetricsSnapshot
pub fn snapshot(&self) -> MetricsSnapshot
Get a snapshot of all metrics.
Sourcepub fn to_json_pretty(&self) -> String
pub fn to_json_pretty(&self) -> String
Export metrics as pretty JSON string.
Sourcepub fn to_prometheus(&self, prefix: &str) -> String
pub fn to_prometheus(&self, prefix: &str) -> String
Export metrics in Prometheus format.