pub struct AutoScaler { /* private fields */ }Expand description
Auto-scaler for dynamic node management
Implementations§
Source§impl AutoScaler
impl AutoScaler
pub fn new(config: AutoScalerConfig) -> Self
Sourcepub fn with_min_nodes(self, min_nodes: usize) -> Self
pub fn with_min_nodes(self, min_nodes: usize) -> Self
Builder pattern for configuration
pub fn with_max_nodes(self, max_nodes: usize) -> Self
pub fn with_scaling_strategy(self, strategy: ScalingStrategy) -> Self
pub fn with_scale_up_threshold(self, threshold: f32) -> Self
pub fn with_scale_down_threshold(self, threshold: f32) -> Self
Sourcepub fn update_and_scale(
&mut self,
metrics: &PerformanceMetrics,
) -> Result<ScalingDecision>
pub fn update_and_scale( &mut self, metrics: &PerformanceMetrics, ) -> Result<ScalingDecision>
Update performance metrics and decide on scaling
pub fn get_current_nodes(&self) -> usize
pub fn get_scaling_history(&self) -> &[ScalingEvent]
Auto Trait Implementations§
impl Freeze for AutoScaler
impl RefUnwindSafe for AutoScaler
impl Send for AutoScaler
impl Sync for AutoScaler
impl Unpin for AutoScaler
impl UnwindSafe for AutoScaler
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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