Skip to main content

DirectionStats

Struct DirectionStats 

Source
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: u64

Hook-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: u64

Bytes 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: u64

Objects 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: u64

Destination 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: u64

Streams 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

Source§

fn clone(&self) -> DirectionStats

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 DirectionStats

Source§

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

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

impl Default for DirectionStats

Source§

fn default() -> DirectionStats

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

impl Eq for DirectionStats

Source§

impl PartialEq for DirectionStats

Source§

fn eq(&self, other: &DirectionStats) -> 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 DirectionStats

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.

Source§

impl<T> Instrument for T

Source§

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

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

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, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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