pub struct ClassStats {
pub name: String,
pub bytes_delivered: u64,
pub bytes_dropped: u64,
pub objects_delivered: u64,
pub objects_dropped: u64,
pub tokens_exhausted_episodes: u64,
pub blocked_episodes: u64,
pub starved_behind_other_class: u64,
}Expand description
Per-class shaping statistics, one entry in ShapeStats.
Every figure is a count, and there is deliberately no duration among
them. Two once were — a blocked total and a hold total — and both would
have been sums of wall-clock time, movable by the machine’s scheduler as
much as by this code, so a gate could only ever have reported them. One
of the two would have misdescribed itself as well:
Overflow::Block stops this crate calling
read() on the source stream and does not stall the peer, because
the transport’s own receive window absorbs megabytes before a publisher
notices anything — so a blocked time measured here would have been how
long this queue refused to read, never how long the publisher was held
up, and a test reading it as publisher backpressure would have been
measuring the wrong thing under a name that invited it. Real backpressure
needs a small
TransportProfile::stream_receive_window,
which is a transport setting and not a shaping one.
What survives is the load-independent companion a gate can read:
Self::blocked_episodes and Self::tokens_exhausted_episodes.
Fields§
§name: StringThe ClassRule::name this row reports, or
an empty string for the default and unshapeable rows.
bytes_delivered: u64Bytes released to the destination stream.
bytes_dropped: u64Bytes discarded by a policy.
objects_delivered: u64Objects released to the destination stream.
objects_dropped: u64Objects discarded by a policy.
tokens_exhausted_episodes: u64Edge-triggered: distinct starvation episodes, not dequeue attempts. Level counting would report the runner’s read batching rather than the shaper.
blocked_episodes: u64Edge-triggered, same reason: distinct episodes of the read side
being stalled by Overflow::Block.
starved_behind_other_class: u64Units that waited behind a different class’s unit on the same
stream. Separates configured shaping from head-of-line blocking;
conflating it with tokens_exhausted_episodes would hide which of
the two a scenario actually produced.
Trait Implementations§
Source§impl Clone for ClassStats
impl Clone for ClassStats
Source§fn clone(&self) -> ClassStats
fn clone(&self) -> ClassStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more