pub struct ControllerSnapshot {
pub cwnd: u32,
pub baseline_latency: Duration,
pub current_latency: Duration,
pub samples_seen: u64,
}Expand description
Read-only view of a controller’s internal state, intended for the progress bar and other observability surfaces.
Snapshots are sampled — never authoritative for enforcement. They
expose the same fields a ratio-based controller reasons about
(cwnd, baseline, current observed latency, sample count) so a
renderer can show why the current cwnd is what it is. Controllers
without a meaningful internal state (e.g. Noop) return
ControllerSnapshot::default; controllers without a latency
signal (e.g. Fixed) populate cwnd only and leave the latency
fields at zero.
latency_ratio is intentionally not pre-computed — the renderer
derives it from current_latency / baseline_latency so there is one
source of truth.
Fields§
§cwnd: u32Current concurrency window the controller would emit on its
next tick. 0 means “no cap configured.”
baseline_latency: DurationLong-horizon baseline latency. For ratio-based controllers
this is the configured baseline percentile over the long sample
window; the renderer treats it as the “uncongested floor”
reference. Duration::ZERO if no signal yet.
current_latency: DurationShort-horizon current latency. For ratio-based controllers
this is the configured current percentile computed over the
short sample window. Duration::ZERO if no fresh samples have
been observed.
samples_seen: u64Cumulative number of samples the controller has consumed.
Trait Implementations§
Source§impl Clone for ControllerSnapshot
impl Clone for ControllerSnapshot
Source§fn clone(&self) -> ControllerSnapshot
fn clone(&self) -> ControllerSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ControllerSnapshot
impl Debug for ControllerSnapshot
Source§impl Default for ControllerSnapshot
impl Default for ControllerSnapshot
Source§fn default() -> ControllerSnapshot
fn default() -> ControllerSnapshot
Source§impl PartialEq for ControllerSnapshot
impl PartialEq for ControllerSnapshot
Source§fn eq(&self, other: &ControllerSnapshot) -> bool
fn eq(&self, other: &ControllerSnapshot) -> bool
self and other values to be equal, and is used by ==.