pub struct DirectionStats {
pub objects_seen: u64,
pub bytes_shaped: u64,
pub objects_expired: u64,
pub streams_reset_by_shaping: u64,
pub streams_with_mixed_classes: u64,
}Expand description
Five totals over the traffic travelling one way.
Reported in two different containers, and reading a figure here means
knowing which one it came out of. As ShapeStats::uplink and
ShapeStats::downlink it is one half of a session’s own totals, and
the split is by direction alone — a session recorder has no leg axis. As
one cell of ProxyStats::per_leg it is one crossing: a connection
and a direction together, so the same unit appears in two cells, once
where it was read and once where it was written. LegStats names the
four.
The distinction is not decoration for the three event figures below.
Every one of them is charged where the traffic arrived, so in a
departure cell all three read zero, and in an arrival cell they describe
destination streams that physically live on the other connection —
they name which of the two flows the shaper acted on, not which socket
the abandoned stream was on. That is deliberate, and stated on each
field, because putting them on the departure cell would separate them
from the bytes_shaped that explains them.
Nothing here is per class: an author who wants a class figure per
direction writes two classes and keys each matcher on
Matcher::side, and these are the totals no
configuration could have separated.
Fields§
§objects_seen: u64Hook-visible units the classifier saw. Objects only, for the reason
ShapeStats::objects_seen gives — including in a departure cell,
where a released stream header is bytes and still not an object.
bytes_shaped: u64Bytes the shaper accounted for — every byte it saw, whether a bucket granted it, a policy dropped it, or it was unshapeable.
The one figure besides objects_seen that is measured at both
crossings, which is what makes the difference between the two cells
of one direction in ProxyStats::per_leg the shaper’s own
retention.
objects_expired: u64Objects whose max_hold elapsed under
Expiry::ResetStream.
Charged to the cell the traffic arrived on. Zero in a departure
cell of ProxyStats::per_leg — an expired object was read and
never written, so the leg it would have left by never carried it.
streams_reset_by_shaping: u64Destination streams abandoned by an overflow or expiry policy, counted against the flow whose traffic they were carrying.
Charged to the cell the traffic arrived on, which is not the
connection the abandoned stream is on: a stream carrying what the
client published is written towards the relay, and this figure
appears in the client leg’s uplink cell beside the bytes_shaped
that explains it. Zero in a departure cell.
streams_with_mixed_classes: u64Streams on which two units resolved to different classes.
Charged to the cell the traffic arrived on, on the same terms as
Self::streams_reset_by_shaping, and zero in a departure
cell. Note that the event beside it,
ProxyEvent::Impairment
carrying
ImpairmentKind::ClassChangedMidStream,
answers the other leg for the same occurrence: an event names the
connection whose write is affected, and a cell here names the flow
the figure belongs to. Correlating the two means expecting them to
disagree by exactly one leg.
Trait Implementations§
Source§impl Clone for DirectionStats
impl Clone for DirectionStats
Source§fn clone(&self) -> DirectionStats
fn clone(&self) -> DirectionStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more