Skip to main content

ShapeStats

Struct ShapeStats 

Source
pub struct ShapeStats {
    pub classes: Vec<ClassStats>,
    pub default_class: ClassStats,
    pub unshapeable: ClassStats,
    pub objects_seen: u64,
    pub bytes_shaped: u64,
    pub objects_expired: u64,
    pub streams_reset_by_shaping: u64,
    pub streams_with_mixed_classes: u64,
    pub uplink: DirectionStats,
    pub downlink: DirectionStats,
}
Expand description

Shaping statistics for one session.

Zero-valued on any session with no ShapeProfile, which is what makes this session shaped nothing a falsifiable claim rather than a promise. Reported separately from Counters so that crate’s whole-struct == Counters::default() assertions keep meaning what they mean.

Read through ProxySession::shape_stats.

The session totals appear twice: flat, summed over the whole session, and again under Self::uplink and Self::downlink for one leg each. The flat figure is the sum of the two by construction, so the two forms can never disagree — pick the leg when the question is which side stalled, and the aggregate when it is whether the profile ran at all.

Every field here is written. A zero row is still reported, never omitted — a class that saw nothing is present and empty, which is the difference between a starved class and a mis-typed one.

Fields§

§classes: Vec<ClassStats>

One entry per configured class, in ShapeProfile::classes order.

§default_class: ClassStats

Units that matched no rule.

§unshapeable: ClassStats

Units with no object metadata at all: subgroup and fetch stream headers, oversized passthrough objects, bypassed streams — every fetch stream on drafts 15-19, which have no fetch object codec. A separate row from Self::default_class, and the distinction is the point: the default row is the rules saw this unit and none claimed it, this row is no rule could have seen it. Merging them would make a mis-aimed matcher indistinguishable from a stream the framer cannot address.

These bytes are not paced: they charge no bucket, so a class rate can be exceeded by exactly one oversized object.

§objects_seen: u64

Hook-visible units the classifier saw.

Objects only. A stream header is counted in Self::bytes_shaped and in Self::unshapeable, and not here.

§bytes_shaped: u64

Bytes the shaper accounted for — every byte it saw, whether a bucket granted it, a policy dropped it, or it was unshapeable. Deliberately not bytes that passed through a bucket: the unshapeable row never touches a bucket, and the conservation identity this total exists for — Σ classes(delivered + dropped) + default + unshapeable == bytes_shaped — has to hold across that row too, or bytes the shaper declined to shape would vanish from the accounting.

§objects_expired: u64

Objects whose max_hold elapsed under Expiry::ResetStream. Zero under the default Expiry::Deliver, which has no producer.

§streams_reset_by_shaping: u64

Destination streams abandoned by an overflow or expiry policy.

§streams_with_mixed_classes: u64

Streams on which two units resolved to different classes.

Head-gating means such a stream’s throughput is decided by whichever class is at the head, so without this count configured shaping and head-of-line blocking are indistinguishable from outside.

§uplink: DirectionStats

The same totals for the client’s traffic on its way to the relay.

Every flat total above is this plus Self::downlink, term by term. Read a leg when the question is which side stalled; read the aggregate when it is did the profile do anything at all. A session shaping only one leg reports the other as all zeros, which is an answer rather than an absence.

§downlink: DirectionStats

The same totals for the relay’s traffic on its way to the client.

Trait Implementations§

Source§

impl Clone for ShapeStats

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ShapeStats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ShapeStats

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for ShapeStats

Source§

impl PartialEq for ShapeStats

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ShapeStats

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more