pub struct StreamStats {
pub tx_seq: u64,
pub rx_seq: u64,
pub inbound_pending: u64,
pub last_activity_ns: u64,
pub active: bool,
pub backpressure_events: u64,
pub tx_credit_remaining: u32,
pub tx_window: u32,
pub credit_grants_received: u64,
pub credit_grants_sent: u64,
}Expand description
Per-stream statistics snapshot. Cheap to produce (reads a handful of atomics) and safe to poll at arbitrary frequency.
Fields§
§tx_seq: u64Next TX sequence number. Reflects “how many packets this stream has enqueued since open” because sequences start at 0.
rx_seq: u64Highest RX sequence number observed so far.
inbound_pending: u64Events currently buffered on the inbound queue (waiting for the caller to poll).
last_activity_ns: u64Nanoseconds since Unix epoch of the last inbound or outbound activity. Used internally for idle eviction; surfaced for diagnostics.
active: boolWhether the stream is active (not closed).
backpressure_events: u64Cumulative count of send_on_stream calls that returned
StreamError::Backpressure because the stream ran out of
credit. Monotonically increasing; reset only by close + reopen.
tx_credit_remaining: u32Bytes of send credit still available. For bounded streams
(tx_window > 0), 0 means the next send of any size will
be rejected as Backpressure; near tx_window means plenty of
headroom. Receiver-driven StreamWindow grants replenish
this counter.
tx_window: u32Configured initial credit window in bytes. Informational —
0 disables backpressure entirely on this stream.
credit_grants_received: u64Cumulative StreamWindow grants received from the peer since
the stream opened (sender side).
credit_grants_sent: u64Cumulative StreamWindow grants emitted to the peer since the
stream opened (receiver side).
Trait Implementations§
Source§impl Clone for StreamStats
impl Clone for StreamStats
Source§fn clone(&self) -> StreamStats
fn clone(&self) -> StreamStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more