pub struct LoadBalancer { /* private fields */ }
Expand description
Balancer that tracks CPU and I/O load history and suggests optimal worker distribution.
Implementations§
Source§impl LoadBalancer
impl LoadBalancer
Sourcepub fn should_rebalance(&self) -> bool
pub fn should_rebalance(&self) -> bool
Check if it’s time to rebalance according to the interval.
Sourcepub fn calculate_optimal_distribution(&self) -> (usize, usize)
pub fn calculate_optimal_distribution(&self) -> (usize, usize)
Calculate optimal distribution of CPU and I/O workers.
Returns a tuple (cpu_workers, io_workers) indicating suggested new limits.
Trait Implementations§
Source§impl Clone for LoadBalancer
impl Clone for LoadBalancer
Source§fn clone(&self) -> LoadBalancer
fn clone(&self) -> LoadBalancer
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 moreAuto Trait Implementations§
impl Freeze for LoadBalancer
impl RefUnwindSafe for LoadBalancer
impl Send for LoadBalancer
impl Sync for LoadBalancer
impl Unpin for LoadBalancer
impl UnwindSafe for LoadBalancer
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