#[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
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 (const: unstable) · 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
impl StructuralPartialEq for AutoscalingPolicyCpuUtilization
Auto Trait Implementations§
impl Freeze for AutoscalingPolicyCpuUtilization
impl RefUnwindSafe for AutoscalingPolicyCpuUtilization
impl Send for AutoscalingPolicyCpuUtilization
impl Sync for AutoscalingPolicyCpuUtilization
impl Unpin for AutoscalingPolicyCpuUtilization
impl UnsafeUnpin for AutoscalingPolicyCpuUtilization
impl UnwindSafe for AutoscalingPolicyCpuUtilization
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request