pub struct ResizerConfig {
pub lower_bound: usize,
pub upper_bound: usize,
pub pressure_threshold: f64,
pub backoff_threshold: f64,
pub rampup_rate: f64,
pub backoff_rate: f64,
pub messages_per_resize: u64,
pub backoff_delay: Duration,
}Fields§
§lower_bound: usize§upper_bound: usize§pressure_threshold: f64Fraction of busy routees that triggers growth (0.0..=1.0).
backoff_threshold: f64Fraction of routees needed to be idle to trigger backoff.
rampup_rate: f64Multiplicative ramp-up factor applied to the current size.
backoff_rate: f64Multiplicative ramp-down factor applied to the current size.
messages_per_resize: u64How many messages must be processed before checking pressure again.
backoff_delay: DurationIdle interval before considering a backoff resize.
Implementations§
Source§impl ResizerConfig
impl ResizerConfig
Sourcepub fn compute_delta(&self, current_size: usize, busy: usize) -> ResizeAdvice
pub fn compute_delta(&self, current_size: usize, busy: usize) -> ResizeAdvice
Decide how many routees to add or remove given the current pool
size and the count of currently-busy routees. Returns the net
delta clamped to [lower_bound, upper_bound].
Trait Implementations§
Source§impl Clone for ResizerConfig
impl Clone for ResizerConfig
Source§fn clone(&self) -> ResizerConfig
fn clone(&self) -> ResizerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResizerConfig
impl Debug for ResizerConfig
Source§impl Default for ResizerConfig
impl Default for ResizerConfig
Source§impl PartialEq for ResizerConfig
impl PartialEq for ResizerConfig
impl StructuralPartialEq for ResizerConfig
Auto Trait Implementations§
impl Freeze for ResizerConfig
impl RefUnwindSafe for ResizerConfig
impl Send for ResizerConfig
impl Sync for ResizerConfig
impl Unpin for ResizerConfig
impl UnsafeUnpin for ResizerConfig
impl UnwindSafe for ResizerConfig
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