pub struct Admission { /* private fields */ }Expand description
Per-source incremental admission controller.
Feed it the aggregate goodput observed at each concurrency level. It compares
the marginal gain against min_gain_frac of the goodput achieved by the first
connection — a scale-free threshold, so it behaves identically on a 1 MB/s
and a 1 GB/s path.
Implementations§
Source§impl Admission
impl Admission
pub fn new(min_gain_frac: f64, max_conns: usize) -> Self
Sourcepub fn observe(&mut self, goodput: f64) -> Admit
pub fn observe(&mut self, goodput: f64) -> Admit
Record the aggregate goodput (bytes/s) observed with self.level() + 1
connections, and decide whether to admit another.
Sourcepub fn best_goodput(&self) -> f64
pub fn best_goodput(&self) -> f64
Best goodput seen, for reporting.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Admission
impl RefUnwindSafe for Admission
impl Send for Admission
impl Sync for Admission
impl Unpin for Admission
impl UnsafeUnpin for Admission
impl UnwindSafe for Admission
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