#[non_exhaustive]
pub struct PredictiveScalingMetricSpecification { pub target_value: Option<f64>, pub predefined_metric_pair_specification: Option<PredictiveScalingPredefinedMetricPair>, pub predefined_scaling_metric_specification: Option<PredictiveScalingPredefinedScalingMetric>, pub predefined_load_metric_specification: Option<PredictiveScalingPredefinedLoadMetric>, pub customized_scaling_metric_specification: Option<PredictiveScalingCustomizedScalingMetric>, pub customized_load_metric_specification: Option<PredictiveScalingCustomizedLoadMetric>, pub customized_capacity_metric_specification: Option<PredictiveScalingCustomizedCapacityMetric>, }
Expand description

This structure specifies the metrics and target utilization settings for a predictive scaling policy.

You must specify either a metric pair, or a load metric and a scaling metric individually. Specifying a metric pair instead of individual metrics provides a simpler way to configure metrics for a scaling policy. You choose the metric pair, and the policy automatically knows the correct sum and average statistics to use for the load metric and the scaling metric.

Example

  • You create a predictive scaling policy and specify ALBRequestCount as the value for the metric pair and 1000.0 as the target value. For this type of metric, you must provide the metric dimension for the corresponding target group, so you also provide a resource label for the Application Load Balancer target group that is attached to your Auto Scaling group.

  • The number of requests the target group receives per minute provides the load metric, and the request count averaged between the members of the target group provides the scaling metric. In CloudWatch, this refers to the RequestCount and RequestCountPerTarget metrics, respectively.

  • For optimal use of predictive scaling, you adhere to the best practice of using a dynamic scaling policy to automatically scale between the minimum capacity and maximum capacity in response to real-time changes in resource utilization.

  • Amazon EC2 Auto Scaling consumes data points for the load metric over the last 14 days and creates an hourly load forecast for predictive scaling. (A minimum of 24 hours of data is required.)

  • After creating the load forecast, Amazon EC2 Auto Scaling determines when to reduce or increase the capacity of your Auto Scaling group in each hour of the forecast period so that the average number of requests received by each instance is as close to 1000 requests per minute as possible at all times.

For information about using custom metrics with predictive scaling, see Advanced predictive scaling policy configurations using custom metrics in the Amazon EC2 Auto Scaling User Guide.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§target_value: Option<f64>

Specifies the target utilization.

Some metrics are based on a count instead of a percentage, such as the request count for an Application Load Balancer or the number of messages in an SQS queue. If the scaling policy specifies one of these metrics, specify the target utilization as the optimal average request or message count per instance during any one-minute interval.

§predefined_metric_pair_specification: Option<PredictiveScalingPredefinedMetricPair>

The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling metric and load metric to use.

§predefined_scaling_metric_specification: Option<PredictiveScalingPredefinedScalingMetric>

The predefined scaling metric specification.

§predefined_load_metric_specification: Option<PredictiveScalingPredefinedLoadMetric>

The predefined load metric specification.

§customized_scaling_metric_specification: Option<PredictiveScalingCustomizedScalingMetric>

The customized scaling metric specification.

§customized_load_metric_specification: Option<PredictiveScalingCustomizedLoadMetric>

The customized load metric specification.

§customized_capacity_metric_specification: Option<PredictiveScalingCustomizedCapacityMetric>

The customized capacity metric specification.

Implementations§

source§

impl PredictiveScalingMetricSpecification

source

pub fn target_value(&self) -> Option<f64>

Specifies the target utilization.

Some metrics are based on a count instead of a percentage, such as the request count for an Application Load Balancer or the number of messages in an SQS queue. If the scaling policy specifies one of these metrics, specify the target utilization as the optimal average request or message count per instance during any one-minute interval.

source

pub fn predefined_metric_pair_specification( &self ) -> Option<&PredictiveScalingPredefinedMetricPair>

The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling metric and load metric to use.

source

pub fn predefined_scaling_metric_specification( &self ) -> Option<&PredictiveScalingPredefinedScalingMetric>

The predefined scaling metric specification.

source

pub fn predefined_load_metric_specification( &self ) -> Option<&PredictiveScalingPredefinedLoadMetric>

The predefined load metric specification.

source

pub fn customized_scaling_metric_specification( &self ) -> Option<&PredictiveScalingCustomizedScalingMetric>

The customized scaling metric specification.

source

pub fn customized_load_metric_specification( &self ) -> Option<&PredictiveScalingCustomizedLoadMetric>

The customized load metric specification.

source

pub fn customized_capacity_metric_specification( &self ) -> Option<&PredictiveScalingCustomizedCapacityMetric>

The customized capacity metric specification.

source§

impl PredictiveScalingMetricSpecification

source

pub fn builder() -> PredictiveScalingMetricSpecificationBuilder

Creates a new builder-style object to manufacture PredictiveScalingMetricSpecification.

Trait Implementations§

source§

impl Clone for PredictiveScalingMetricSpecification

source§

fn clone(&self) -> PredictiveScalingMetricSpecification

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PredictiveScalingMetricSpecification

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for PredictiveScalingMetricSpecification

source§

fn eq(&self, other: &PredictiveScalingMetricSpecification) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for PredictiveScalingMetricSpecification

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more