Class CfnScalingPolicyPropsMixin.PredictiveScalingMetricSpecificationProperty
A structure that specifies a metric specification for the MetricSpecifications property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingConfiguration property type.
Inherited Members
Namespace: Amazon.CDK.Mixins.Preview.AWS.AutoScaling.Mixins
Assembly: Amazon.CDK.Mixins.Preview.dll
Syntax (csharp)
public class CfnScalingPolicyPropsMixin.PredictiveScalingMetricSpecificationProperty : CfnScalingPolicyPropsMixin.IPredictiveScalingMetricSpecificationProperty
Syntax (vb)
Public Class CfnScalingPolicyPropsMixin.PredictiveScalingMetricSpecificationProperty Implements CfnScalingPolicyPropsMixin.IPredictiveScalingMetricSpecificationProperty
Remarks
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
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 .
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Mixins.Preview.AWS.AutoScaling.Mixins;
var predictiveScalingMetricSpecificationProperty = new PredictiveScalingMetricSpecificationProperty {
CustomizedCapacityMetricSpecification = new PredictiveScalingCustomizedCapacityMetricProperty {
MetricDataQueries = new [] { new MetricDataQueryProperty {
Expression = "expression",
Id = "id",
Label = "label",
MetricStat = new MetricStatProperty {
Metric = new MetricProperty {
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} },
MetricName = "metricName",
Namespace = "namespace"
},
Stat = "stat",
Unit = "unit"
},
ReturnData = false
} }
},
CustomizedLoadMetricSpecification = new PredictiveScalingCustomizedLoadMetricProperty {
MetricDataQueries = new [] { new MetricDataQueryProperty {
Expression = "expression",
Id = "id",
Label = "label",
MetricStat = new MetricStatProperty {
Metric = new MetricProperty {
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} },
MetricName = "metricName",
Namespace = "namespace"
},
Stat = "stat",
Unit = "unit"
},
ReturnData = false
} }
},
CustomizedScalingMetricSpecification = new PredictiveScalingCustomizedScalingMetricProperty {
MetricDataQueries = new [] { new MetricDataQueryProperty {
Expression = "expression",
Id = "id",
Label = "label",
MetricStat = new MetricStatProperty {
Metric = new MetricProperty {
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} },
MetricName = "metricName",
Namespace = "namespace"
},
Stat = "stat",
Unit = "unit"
},
ReturnData = false
} }
},
PredefinedLoadMetricSpecification = new PredictiveScalingPredefinedLoadMetricProperty {
PredefinedMetricType = "predefinedMetricType",
ResourceLabel = "resourceLabel"
},
PredefinedMetricPairSpecification = new PredictiveScalingPredefinedMetricPairProperty {
PredefinedMetricType = "predefinedMetricType",
ResourceLabel = "resourceLabel"
},
PredefinedScalingMetricSpecification = new PredictiveScalingPredefinedScalingMetricProperty {
PredefinedMetricType = "predefinedMetricType",
ResourceLabel = "resourceLabel"
},
TargetValue = 123
};
Synopsis
Constructors
| PredictiveScalingMetricSpecificationProperty() | A structure that specifies a metric specification for the |
Properties
| CustomizedCapacityMetricSpecification | The customized capacity metric specification. |
| CustomizedLoadMetricSpecification | The customized load metric specification. |
| CustomizedScalingMetricSpecification | The customized scaling metric specification. |
| PredefinedLoadMetricSpecification | The predefined load metric specification. |
| PredefinedMetricPairSpecification | The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling metric and load metric to use. |
| PredefinedScalingMetricSpecification | The predefined scaling metric specification. |
| TargetValue | Specifies the target utilization. |
Constructors
PredictiveScalingMetricSpecificationProperty()
A structure that specifies a metric specification for the MetricSpecifications property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingConfiguration property type.
public PredictiveScalingMetricSpecificationProperty()
Remarks
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
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 .
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Mixins.Preview.AWS.AutoScaling.Mixins;
var predictiveScalingMetricSpecificationProperty = new PredictiveScalingMetricSpecificationProperty {
CustomizedCapacityMetricSpecification = new PredictiveScalingCustomizedCapacityMetricProperty {
MetricDataQueries = new [] { new MetricDataQueryProperty {
Expression = "expression",
Id = "id",
Label = "label",
MetricStat = new MetricStatProperty {
Metric = new MetricProperty {
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} },
MetricName = "metricName",
Namespace = "namespace"
},
Stat = "stat",
Unit = "unit"
},
ReturnData = false
} }
},
CustomizedLoadMetricSpecification = new PredictiveScalingCustomizedLoadMetricProperty {
MetricDataQueries = new [] { new MetricDataQueryProperty {
Expression = "expression",
Id = "id",
Label = "label",
MetricStat = new MetricStatProperty {
Metric = new MetricProperty {
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} },
MetricName = "metricName",
Namespace = "namespace"
},
Stat = "stat",
Unit = "unit"
},
ReturnData = false
} }
},
CustomizedScalingMetricSpecification = new PredictiveScalingCustomizedScalingMetricProperty {
MetricDataQueries = new [] { new MetricDataQueryProperty {
Expression = "expression",
Id = "id",
Label = "label",
MetricStat = new MetricStatProperty {
Metric = new MetricProperty {
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} },
MetricName = "metricName",
Namespace = "namespace"
},
Stat = "stat",
Unit = "unit"
},
ReturnData = false
} }
},
PredefinedLoadMetricSpecification = new PredictiveScalingPredefinedLoadMetricProperty {
PredefinedMetricType = "predefinedMetricType",
ResourceLabel = "resourceLabel"
},
PredefinedMetricPairSpecification = new PredictiveScalingPredefinedMetricPairProperty {
PredefinedMetricType = "predefinedMetricType",
ResourceLabel = "resourceLabel"
},
PredefinedScalingMetricSpecification = new PredictiveScalingPredefinedScalingMetricProperty {
PredefinedMetricType = "predefinedMetricType",
ResourceLabel = "resourceLabel"
},
TargetValue = 123
};
Properties
CustomizedCapacityMetricSpecification
The customized capacity metric specification.
public object? CustomizedCapacityMetricSpecification { get; set; }
Property Value
Remarks
Type union: either IResolvable or CfnScalingPolicyPropsMixin.IPredictiveScalingCustomizedCapacityMetricProperty
CustomizedLoadMetricSpecification
The customized load metric specification.
public object? CustomizedLoadMetricSpecification { get; set; }
Property Value
Remarks
Type union: either IResolvable or CfnScalingPolicyPropsMixin.IPredictiveScalingCustomizedLoadMetricProperty
CustomizedScalingMetricSpecification
The customized scaling metric specification.
public object? CustomizedScalingMetricSpecification { get; set; }
Property Value
Remarks
Type union: either IResolvable or CfnScalingPolicyPropsMixin.IPredictiveScalingCustomizedScalingMetricProperty
PredefinedLoadMetricSpecification
The predefined load metric specification.
public object? PredefinedLoadMetricSpecification { get; set; }
Property Value
Remarks
Type union: either IResolvable or CfnScalingPolicyPropsMixin.IPredictiveScalingPredefinedLoadMetricProperty
PredefinedMetricPairSpecification
The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling metric and load metric to use.
public object? PredefinedMetricPairSpecification { get; set; }
Property Value
Remarks
Type union: either IResolvable or CfnScalingPolicyPropsMixin.IPredictiveScalingPredefinedMetricPairProperty
PredefinedScalingMetricSpecification
The predefined scaling metric specification.
public object? PredefinedScalingMetricSpecification { get; set; }
Property Value
Remarks
Type union: either IResolvable or CfnScalingPolicyPropsMixin.IPredictiveScalingPredefinedScalingMetricProperty
TargetValue
Specifies the target utilization.
public double? TargetValue { get; set; }
Property Value
Remarks
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.