#[non_exhaustive]pub struct AutoscalingPolicyCpuUtilization {
pub predictive_method: Option<PredictiveMethod>,
pub utilization_target: Option<f64>,
/* private fields */
}autoscalers or region-autoscalers only.Expand description
CPU utilization policy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.predictive_method: Option<PredictiveMethod>Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are:
- NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics.
- OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand.
utilization_target: Option<f64>The target CPU utilization that the autoscaler maintains. Must be a float value in the range (0, 1]. If not specified, the default is0.6.
If the CPU level is below the target utilization, the autoscaler scales in the number of instances until it reaches the minimum number of instances you specified or until the average CPU of your instances reaches the target utilization.
If the average CPU is above the target utilization, the autoscaler scales out until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization.
Implementations§
Source§impl AutoscalingPolicyCpuUtilization
impl AutoscalingPolicyCpuUtilization
pub fn new() -> Self
Sourcepub fn set_predictive_method<T>(self, v: T) -> Selfwhere
T: Into<PredictiveMethod>,
pub fn set_predictive_method<T>(self, v: T) -> Selfwhere
T: Into<PredictiveMethod>,
Sets the value of predictive_method.
§Example
use google_cloud_compute_v1::model::autoscaling_policy_cpu_utilization::PredictiveMethod;
let x0 = AutoscalingPolicyCpuUtilization::new().set_predictive_method(PredictiveMethod::OptimizeAvailability);Sourcepub fn set_or_clear_predictive_method<T>(self, v: Option<T>) -> Selfwhere
T: Into<PredictiveMethod>,
pub fn set_or_clear_predictive_method<T>(self, v: Option<T>) -> Selfwhere
T: Into<PredictiveMethod>,
Sets or clears the value of predictive_method.
§Example
use google_cloud_compute_v1::model::autoscaling_policy_cpu_utilization::PredictiveMethod;
let x0 = AutoscalingPolicyCpuUtilization::new().set_or_clear_predictive_method(Some(PredictiveMethod::OptimizeAvailability));
let x_none = AutoscalingPolicyCpuUtilization::new().set_or_clear_predictive_method(None::<PredictiveMethod>);Sourcepub fn set_utilization_target<T>(self, v: T) -> Self
pub fn set_utilization_target<T>(self, v: T) -> Self
Sets the value of utilization_target.
§Example
let x = AutoscalingPolicyCpuUtilization::new().set_utilization_target(42.0);Sourcepub fn set_or_clear_utilization_target<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_utilization_target<T>(self, v: Option<T>) -> Self
Sets or clears the value of utilization_target.
§Example
let x = AutoscalingPolicyCpuUtilization::new().set_or_clear_utilization_target(Some(42.0));
let x = AutoscalingPolicyCpuUtilization::new().set_or_clear_utilization_target(None::<f32>);Trait Implementations§
Source§impl Clone for AutoscalingPolicyCpuUtilization
impl Clone for AutoscalingPolicyCpuUtilization
Source§fn clone(&self) -> AutoscalingPolicyCpuUtilization
fn clone(&self) -> AutoscalingPolicyCpuUtilization
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for AutoscalingPolicyCpuUtilization
impl Default for AutoscalingPolicyCpuUtilization
Source§fn default() -> AutoscalingPolicyCpuUtilization
fn default() -> AutoscalingPolicyCpuUtilization
Source§impl PartialEq for AutoscalingPolicyCpuUtilization
impl PartialEq for AutoscalingPolicyCpuUtilization
Source§fn eq(&self, other: &AutoscalingPolicyCpuUtilization) -> bool
fn eq(&self, other: &AutoscalingPolicyCpuUtilization) -> bool
self and other values to be equal, and is used by ==.