pub struct PredictiveLoadBalancer { /* private fields */ }
Expand description
Predictive load balancer using machine learning-like predictions
Implementations§
Source§impl PredictiveLoadBalancer
impl PredictiveLoadBalancer
Sourcepub fn predict_execution_time(&self, taskfeatures: &TaskFeatures) -> Duration
pub fn predict_execution_time(&self, taskfeatures: &TaskFeatures) -> Duration
Predict execution time for a task
Sourcepub fn assign_task(&self, taskfeatures: &TaskFeatures) -> usize
pub fn assign_task(&self, taskfeatures: &TaskFeatures) -> usize
Assign task to optimal worker based on predicted load
Sourcepub fn update_model(&self, task_features: &TaskFeatures, actualtime: Duration)
pub fn update_model(&self, task_features: &TaskFeatures, actualtime: Duration)
Update model with actual execution time
Sourcepub fn update_worker_load(&self, worker_id: usize, completedtime: Duration)
pub fn update_worker_load(&self, worker_id: usize, completedtime: Duration)
Update worker load (when task completes)
Auto Trait Implementations§
impl !Freeze for PredictiveLoadBalancer
impl RefUnwindSafe for PredictiveLoadBalancer
impl Send for PredictiveLoadBalancer
impl Sync for PredictiveLoadBalancer
impl Unpin for PredictiveLoadBalancer
impl UnwindSafe for PredictiveLoadBalancer
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more