pub struct AimdController { /* private fields */ }Expand description
Additive-increase / multiplicative-decrease controller. Pure + deterministic.
Implementations§
Source§impl AimdController
impl AimdController
Sourcepub fn new(cfg: &AdaptiveBatchConfig, initial: usize) -> Self
pub fn new(cfg: &AdaptiveBatchConfig, initial: usize) -> Self
Build a controller. initial is clamped into [min, max] (cold-start =
the source’s actual page size when run_stream passes the first page len).
pub fn current(&self) -> usize
pub fn cooldown_active(&self) -> bool
Sourcepub fn p50_latency_ms(&self) -> Option<u64>
pub fn p50_latency_ms(&self) -> Option<u64>
p50 of the rolling latency window (ms), if any samples present.
Sourcepub fn observe(&mut self, obs: Observation) -> Option<Adjustment>
pub fn observe(&mut self, obs: Observation) -> Option<Adjustment>
Feed one sub-batch observation; returns Some(Adjustment) when the size
changed. First-match-wins: error shrink → cooldown → latency target →
success growth.
Auto Trait Implementations§
impl Freeze for AimdController
impl RefUnwindSafe for AimdController
impl Send for AimdController
impl Sync for AimdController
impl Unpin for AimdController
impl UnsafeUnpin for AimdController
impl UnwindSafe for AimdController
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more