Struct google_api_proto::google::cloud::compute::v1::AutoscalingPolicy
source · pub struct AutoscalingPolicy {
pub cool_down_period_sec: Option<i32>,
pub cpu_utilization: Option<AutoscalingPolicyCpuUtilization>,
pub custom_metric_utilizations: Vec<AutoscalingPolicyCustomMetricUtilization>,
pub load_balancing_utilization: Option<AutoscalingPolicyLoadBalancingUtilization>,
pub max_num_replicas: Option<i32>,
pub min_num_replicas: Option<i32>,
pub mode: Option<String>,
pub scale_in_control: Option<AutoscalingPolicyScaleInControl>,
pub scaling_schedules: BTreeMap<String, AutoscalingPolicyScalingSchedule>,
}
Expand description
Cloud Autoscaler policy.
Fields§
§cool_down_period_sec: Option<i32>
The number of seconds that your application takes to initialize on a VM instance. This is referred to as the initialization period. Specifying an accurate initialization period improves autoscaler decisions. For example, when scaling out, the autoscaler ignores data from VMs that are still initializing because those VMs might not yet represent normal usage of your application. The default initialization period is 60 seconds. Initialization periods might vary because of numerous factors. We recommend that you test how long your application takes to initialize. To do this, create a VM and time your application’s startup process.
cpu_utilization: Option<AutoscalingPolicyCpuUtilization>
Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
custom_metric_utilizations: Vec<AutoscalingPolicyCustomMetricUtilization>
Configuration parameters of autoscaling based on a custom metric.
load_balancing_utilization: Option<AutoscalingPolicyLoadBalancingUtilization>
Configuration parameters of autoscaling based on load balancer.
max_num_replicas: Option<i32>
The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas.
min_num_replicas: Option<i32>
The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed.
mode: Option<String>
Defines the operating mode for this policy. The following modes are available: - OFF: Disables the autoscaler but maintains its configuration. - ONLY_SCALE_OUT: Restricts the autoscaler to add VM instances only. - ON: Enables all autoscaler activities according to its policy. For more information, see “Turning off or restricting an autoscaler” Check the Mode enum for the list of possible values.
scale_in_control: Option<AutoscalingPolicyScaleInControl>
§scaling_schedules: BTreeMap<String, AutoscalingPolicyScalingSchedule>
Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed.
Implementations§
source§impl AutoscalingPolicy
impl AutoscalingPolicy
sourcepub fn max_num_replicas(&self) -> i32
pub fn max_num_replicas(&self) -> i32
Returns the value of max_num_replicas
, or the default value if max_num_replicas
is unset.
sourcepub fn cool_down_period_sec(&self) -> i32
pub fn cool_down_period_sec(&self) -> i32
Returns the value of cool_down_period_sec
, or the default value if cool_down_period_sec
is unset.
sourcepub fn min_num_replicas(&self) -> i32
pub fn min_num_replicas(&self) -> i32
Returns the value of min_num_replicas
, or the default value if min_num_replicas
is unset.
Trait Implementations§
source§impl Clone for AutoscalingPolicy
impl Clone for AutoscalingPolicy
source§fn clone(&self) -> AutoscalingPolicy
fn clone(&self) -> AutoscalingPolicy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AutoscalingPolicy
impl Debug for AutoscalingPolicy
source§impl Default for AutoscalingPolicy
impl Default for AutoscalingPolicy
source§impl Message for AutoscalingPolicy
impl Message for AutoscalingPolicy
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for AutoscalingPolicy
impl PartialEq for AutoscalingPolicy
source§fn eq(&self, other: &AutoscalingPolicy) -> bool
fn eq(&self, other: &AutoscalingPolicy) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for AutoscalingPolicy
Auto Trait Implementations§
impl Freeze for AutoscalingPolicy
impl RefUnwindSafe for AutoscalingPolicy
impl Send for AutoscalingPolicy
impl Sync for AutoscalingPolicy
impl Unpin for AutoscalingPolicy
impl UnwindSafe for AutoscalingPolicy
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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