Skip to main content

TrafficStats

Struct TrafficStats 

Source
pub struct TrafficStats {
Show 13 fields pub duration_s: f64, pub num_req: usize, pub avg_isl: f64, pub avg_osl: f64, pub avg_ttft_ms: f64, pub avg_itl_ms: f64, pub shape_count: usize, pub ttft_count: usize, pub itl_count: usize, pub avg_accept_length: Option<f64>, pub avg_kv_hit_rate: f64, pub hit_rate_count: usize, pub accept_length_forward_count: usize,
}
Expand description

Accumulated traffic statistics returned by [TrafficAccumulator::drain].

IMPORTANT: When fields here are added or renamed, update the PyO3 binding in lib/bindings/python/rust/llm/replay.rs (drain_traffic method) so the exported JSON dict matches. The Python adapter in replay_adapter.py reads these keys by name.

Fields§

§duration_s: f64§num_req: usize

Requests offered to the replay runtime during the window. This matches the live planner’s requests_started_total demand signal.

§avg_isl: f64§avg_osl: f64§avg_ttft_ms: f64§avg_itl_ms: f64§shape_count: usize

Completed, non-rejected requests behind avg_isl and avg_osl.

§ttft_count: usize

Completed requests behind avg_ttft_ms.

§itl_count: usize

Completed requests behind avg_itl_ms.

§avg_accept_length: Option<f64>

Mean visible tokens produced per decode request-forward, including the base token. None means the window had no decode forwards.

§avg_kv_hit_rate: f64

Mean prefix-cache hit rate (0.0-1.0) across router admissions in the window, computed as mean(overlap_blocks / isl_blocks) over admitted requests (i.e. the arithmetic mean of per-request ratios). Matches the semantics of the real router’s dynamo_component_router_kv_hit_rate Prometheus histogram, which observes one overlap/isl sample per request; the PromQL query sum(increase(_sum)) / sum(increase(_count)) returns the arithmetic mean of those samples, independent of per-request ISL size.

§hit_rate_count: usize

Number of samples behind avg_kv_hit_rate (its denominator: router admissions with isl_blocks > 0). Carried so a consumer that merges several drained windows can reconstruct the exact sample-weighted mean rather than approximating it with num_req.

§accept_length_forward_count: usize

Number of decode request-forwards behind avg_accept_length (its denominator). Same purpose as hit_rate_count for cross-window merges.

Trait Implementations§

Source§

impl Clone for TrafficStats

Source§

fn clone(&self) -> TrafficStats

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 TrafficStats

Source§

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

Formats the value using the given formatter. Read more

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> BlockMetadata for T
where T: Clone + Send + Sync + 'static,

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<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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = Infallible

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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