worker_autoscaler_policy - OmniCloudOrg/OmniOrchestrator GitHub Wiki
policy (src/worker_autoscaler)
Path: src/worker_autoscaler/policy.rs
Table of Contents
Public Items
struct ScalingPolicy
Definition
pub struct ScalingPolicy {
/// The maximum number of worker nodes allowed in the cluster
pub max_worker_count: usize,
/// The minimum number of worker nodes allowed in the cluster
pub min_worker_count: usize,
/// The cooldown period between scaling actions
pub cooldown_period: Duration,
/// Custom metrics and their thresholds for scaling decisions
pub metrics_thresholds: HashMap<String, MetricThreshold>,
/// Number of workers to add during scale up
pub scale_up_increment: usize,
/// Number of workers to remove during scale down
pub scale_down_increment: usize,
/// Time to wait before considering a scale down action
pub scale_down_delay: Duration,
/// Maximum percentage of workers that can be scaled down at once
pub max_scale_down_percentage: f32,
/// Whether to enable automatic scaling
pub autoscaling_enabled: bool,
}
Documentation
Configuration for scaling operations
fn create_default_cpu_memory_scaling_policy
Definition
pub fn create_default_cpu_memory_scaling_policy() -> ScalingPolicy {
let mut policy = ScalingPolicy::default();