@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class PredictiveScalingMetricSpecification extends Object implements Serializable, Cloneable
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.
Constructor and Description |
---|
PredictiveScalingMetricSpecification() |
Modifier and Type | Method and Description |
---|---|
PredictiveScalingMetricSpecification |
clone() |
boolean |
equals(Object obj) |
PredictiveScalingCustomizedCapacityMetric |
getCustomizedCapacityMetricSpecification()
The customized capacity metric specification.
|
PredictiveScalingCustomizedLoadMetric |
getCustomizedLoadMetricSpecification()
The customized load metric specification.
|
PredictiveScalingCustomizedScalingMetric |
getCustomizedScalingMetricSpecification()
The customized scaling metric specification.
|
PredictiveScalingPredefinedLoadMetric |
getPredefinedLoadMetricSpecification()
The predefined load metric specification.
|
PredictiveScalingPredefinedMetricPair |
getPredefinedMetricPairSpecification()
The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling
metric and load metric to use.
|
PredictiveScalingPredefinedScalingMetric |
getPredefinedScalingMetricSpecification()
The predefined scaling metric specification.
|
Double |
getTargetValue()
Specifies the target utilization.
|
int |
hashCode() |
void |
setCustomizedCapacityMetricSpecification(PredictiveScalingCustomizedCapacityMetric customizedCapacityMetricSpecification)
The customized capacity metric specification.
|
void |
setCustomizedLoadMetricSpecification(PredictiveScalingCustomizedLoadMetric customizedLoadMetricSpecification)
The customized load metric specification.
|
void |
setCustomizedScalingMetricSpecification(PredictiveScalingCustomizedScalingMetric customizedScalingMetricSpecification)
The customized scaling metric specification.
|
void |
setPredefinedLoadMetricSpecification(PredictiveScalingPredefinedLoadMetric predefinedLoadMetricSpecification)
The predefined load metric specification.
|
void |
setPredefinedMetricPairSpecification(PredictiveScalingPredefinedMetricPair predefinedMetricPairSpecification)
The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling
metric and load metric to use.
|
void |
setPredefinedScalingMetricSpecification(PredictiveScalingPredefinedScalingMetric predefinedScalingMetricSpecification)
The predefined scaling metric specification.
|
void |
setTargetValue(Double targetValue)
Specifies the target utilization.
|
String |
toString()
Returns a string representation of this object.
|
PredictiveScalingMetricSpecification |
withCustomizedCapacityMetricSpecification(PredictiveScalingCustomizedCapacityMetric customizedCapacityMetricSpecification)
The customized capacity metric specification.
|
PredictiveScalingMetricSpecification |
withCustomizedLoadMetricSpecification(PredictiveScalingCustomizedLoadMetric customizedLoadMetricSpecification)
The customized load metric specification.
|
PredictiveScalingMetricSpecification |
withCustomizedScalingMetricSpecification(PredictiveScalingCustomizedScalingMetric customizedScalingMetricSpecification)
The customized scaling metric specification.
|
PredictiveScalingMetricSpecification |
withPredefinedLoadMetricSpecification(PredictiveScalingPredefinedLoadMetric predefinedLoadMetricSpecification)
The predefined load metric specification.
|
PredictiveScalingMetricSpecification |
withPredefinedMetricPairSpecification(PredictiveScalingPredefinedMetricPair predefinedMetricPairSpecification)
The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling
metric and load metric to use.
|
PredictiveScalingMetricSpecification |
withPredefinedScalingMetricSpecification(PredictiveScalingPredefinedScalingMetric predefinedScalingMetricSpecification)
The predefined scaling metric specification.
|
PredictiveScalingMetricSpecification |
withTargetValue(Double targetValue)
Specifies the target utilization.
|
public PredictiveScalingMetricSpecification()
public void setTargetValue(Double targetValue)
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.
targetValue
- 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.
public Double getTargetValue()
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.
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.
public PredictiveScalingMetricSpecification withTargetValue(Double targetValue)
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.
targetValue
- 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.
public void setPredefinedMetricPairSpecification(PredictiveScalingPredefinedMetricPair predefinedMetricPairSpecification)
The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling metric and load metric to use.
predefinedMetricPairSpecification
- The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate
scaling metric and load metric to use.public PredictiveScalingPredefinedMetricPair getPredefinedMetricPairSpecification()
The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling metric and load metric to use.
public PredictiveScalingMetricSpecification withPredefinedMetricPairSpecification(PredictiveScalingPredefinedMetricPair predefinedMetricPairSpecification)
The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling metric and load metric to use.
predefinedMetricPairSpecification
- The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate
scaling metric and load metric to use.public void setPredefinedScalingMetricSpecification(PredictiveScalingPredefinedScalingMetric predefinedScalingMetricSpecification)
The predefined scaling metric specification.
predefinedScalingMetricSpecification
- The predefined scaling metric specification.public PredictiveScalingPredefinedScalingMetric getPredefinedScalingMetricSpecification()
The predefined scaling metric specification.
public PredictiveScalingMetricSpecification withPredefinedScalingMetricSpecification(PredictiveScalingPredefinedScalingMetric predefinedScalingMetricSpecification)
The predefined scaling metric specification.
predefinedScalingMetricSpecification
- The predefined scaling metric specification.public void setPredefinedLoadMetricSpecification(PredictiveScalingPredefinedLoadMetric predefinedLoadMetricSpecification)
The predefined load metric specification.
predefinedLoadMetricSpecification
- The predefined load metric specification.public PredictiveScalingPredefinedLoadMetric getPredefinedLoadMetricSpecification()
The predefined load metric specification.
public PredictiveScalingMetricSpecification withPredefinedLoadMetricSpecification(PredictiveScalingPredefinedLoadMetric predefinedLoadMetricSpecification)
The predefined load metric specification.
predefinedLoadMetricSpecification
- The predefined load metric specification.public void setCustomizedScalingMetricSpecification(PredictiveScalingCustomizedScalingMetric customizedScalingMetricSpecification)
The customized scaling metric specification.
customizedScalingMetricSpecification
- The customized scaling metric specification.public PredictiveScalingCustomizedScalingMetric getCustomizedScalingMetricSpecification()
The customized scaling metric specification.
public PredictiveScalingMetricSpecification withCustomizedScalingMetricSpecification(PredictiveScalingCustomizedScalingMetric customizedScalingMetricSpecification)
The customized scaling metric specification.
customizedScalingMetricSpecification
- The customized scaling metric specification.public void setCustomizedLoadMetricSpecification(PredictiveScalingCustomizedLoadMetric customizedLoadMetricSpecification)
The customized load metric specification.
customizedLoadMetricSpecification
- The customized load metric specification.public PredictiveScalingCustomizedLoadMetric getCustomizedLoadMetricSpecification()
The customized load metric specification.
public PredictiveScalingMetricSpecification withCustomizedLoadMetricSpecification(PredictiveScalingCustomizedLoadMetric customizedLoadMetricSpecification)
The customized load metric specification.
customizedLoadMetricSpecification
- The customized load metric specification.public void setCustomizedCapacityMetricSpecification(PredictiveScalingCustomizedCapacityMetric customizedCapacityMetricSpecification)
The customized capacity metric specification.
customizedCapacityMetricSpecification
- The customized capacity metric specification.public PredictiveScalingCustomizedCapacityMetric getCustomizedCapacityMetricSpecification()
The customized capacity metric specification.
public PredictiveScalingMetricSpecification withCustomizedCapacityMetricSpecification(PredictiveScalingCustomizedCapacityMetric customizedCapacityMetricSpecification)
The customized capacity metric specification.
customizedCapacityMetricSpecification
- The customized capacity metric specification.public String toString()
toString
in class Object
Object.toString()
public PredictiveScalingMetricSpecification clone()