Skip to main content

EndpointPhases

Struct EndpointPhases 

Source
pub struct EndpointPhases {
    pub decode_ns: u64,
    pub user_ns: u64,
    pub encode_ns: u64,
    pub queue_ns: u64,
    pub adapter_ns: u64,
    pub held_episodes: Option<u32>,
    pub held_state_bytes: Option<u64>,
    pub in_flight: u32,
    pub lane_skew_ns: Option<u64>,
}
Expand description

The endpoint-local split of JoinResponse.endpoint_total_ns (ns), plus the pre-handler wait and slot depth a pipelining model endpoint reports.

A zero duration is “not measured”: a peer built before these fields existed sends none of them, and a reader sees this default. The gauges are Option because for them a measured zero is a real sample (an even vector has zero skew; an engine that just evicted holds zero episodes) that must stay distinguishable from a peer that never measures. in_flight is model-only; lane_skew_ns is env-only.

Fields§

§decode_ns: u64

Decoding the request off the wire.

§user_ns: u64

The env or model implementation’s own work, user code included.

§encode_ns: u64

Encoding the response onto the wire.

§queue_ns: u64

Wait before the handler ran. Model: concurrency permit, route gate, handler lock. Env: the env lock, which serializes ops on one env.

§adapter_ns: u64

Adapter work inside user_ns (observation assembly + action apply) — a sub-span, not additive: the model’s own forward is user_ns - adapter_ns. Model-only, and zero for a spec-less route.

§held_episodes: Option<u32>

Episodes whose frame-stack windows the endpoint’s adapter engine held when the response was stamped, across all routes. Model-only; None from a handler that keeps no such accounting.

§held_state_bytes: Option<u64>

Bytes those held frame-stack windows occupy. Model-only; None from a handler that keeps no such accounting.

§in_flight: u32

Requests holding a concurrency slot when this request was dispatched to its handler (>= 1): slot occupancy, not parallelism.

§lane_skew_ns: Option<u64>

Straggler skew across a vector env’s lanes for this op — see lane_skew_ns. Env-only; None from an env that does not time its lanes, Some(0) from one whose lanes were even.

Implementations§

Source§

impl EndpointPhases

Source

pub fn reported(ns: u64) -> Option<u64>

Wire form of a measurement: an unmeasured (zero) phase is left off the message rather than sent as a 0 a reader cannot tell from silence.

Source

pub fn from_durations( decode: Duration, user: Duration, encode: Duration, ) -> EndpointPhases

Build a split from measured phase durations, saturating at u64::MAX ns.

Source

pub fn nest( decode_ns: u64, call_ns: u64, encode_ns: u64, inner: EndpointPhases, ) -> EndpointPhases

Fold an inner layer’s own split into this layer’s decode/call/encode measurement. The inner layer’s decode and encode accumulate into the outer ones, and user_ns keeps the rest of the call — the inner user work plus whatever it cost to reach it (GIL wait, adapter overhead) — so the phases still sum to this layer’s whole measurement. An inner layer that measures nothing, or whose wire share does not even fit inside the measured call, leaves the whole call as user time.

Source

pub fn from_env_response(response: &JoinResponse) -> EndpointPhases

Read the split an env peer stamped; all-zero for a peer that sends none.

Source

pub fn from_model_response(response: &JoinResponse) -> EndpointPhases

Read the split a model peer stamped; all-zero for a peer that sends none.

Trait Implementations§

Source§

impl Clone for EndpointPhases

Source§

fn clone(&self) -> EndpointPhases

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 Copy for EndpointPhases

Source§

impl Debug for EndpointPhases

Source§

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

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

impl Default for EndpointPhases

Source§

fn default() -> EndpointPhases

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

impl Eq for EndpointPhases

Source§

impl PartialEq for EndpointPhases

Source§

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

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
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