Class CfnScalingPolicy.PredictiveScalingMetricSpecificationProperty
A structure that specifies a metric specification for the MetricSpecifications
property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingConfiguration property type.
Inheritance
Namespace: Amazon.CDK.AWS.AutoScaling
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class PredictiveScalingMetricSpecificationProperty : Object, CfnScalingPolicy.IPredictiveScalingMetricSpecificationProperty
Syntax (vb)
Public Class PredictiveScalingMetricSpecificationProperty
Inherits Object
Implements CfnScalingPolicy.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.AWS.AutoScaling;
var predictiveScalingMetricSpecificationProperty = new PredictiveScalingMetricSpecificationProperty {
TargetValue = 123,
// the properties below are optional
CustomizedCapacityMetricSpecification = new PredictiveScalingCustomizedCapacityMetricProperty {
MetricDataQueries = new [] { new MetricDataQueryProperty {
Id = "id",
// the properties below are optional
Expression = "expression",
Label = "label",
MetricStat = new MetricStatProperty {
Metric = new MetricProperty {
MetricName = "metricName",
Namespace = "namespace",
// the properties below are optional
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} }
},
Stat = "stat",
// the properties below are optional
Unit = "unit"
},
ReturnData = false
} }
},
CustomizedLoadMetricSpecification = new PredictiveScalingCustomizedLoadMetricProperty {
MetricDataQueries = new [] { new MetricDataQueryProperty {
Id = "id",
// the properties below are optional
Expression = "expression",
Label = "label",
MetricStat = new MetricStatProperty {
Metric = new MetricProperty {
MetricName = "metricName",
Namespace = "namespace",
// the properties below are optional
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} }
},
Stat = "stat",
// the properties below are optional
Unit = "unit"
},
ReturnData = false
} }
},
CustomizedScalingMetricSpecification = new PredictiveScalingCustomizedScalingMetricProperty {
MetricDataQueries = new [] { new MetricDataQueryProperty {
Id = "id",
// the properties below are optional
Expression = "expression",
Label = "label",
MetricStat = new MetricStatProperty {
Metric = new MetricProperty {
MetricName = "metricName",
Namespace = "namespace",
// the properties below are optional
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} }
},
Stat = "stat",
// the properties below are optional
Unit = "unit"
},
ReturnData = false
} }
},
PredefinedLoadMetricSpecification = new PredictiveScalingPredefinedLoadMetricProperty {
PredefinedMetricType = "predefinedMetricType",
// the properties below are optional
ResourceLabel = "resourceLabel"
},
PredefinedMetricPairSpecification = new PredictiveScalingPredefinedMetricPairProperty {
PredefinedMetricType = "predefinedMetricType",
// the properties below are optional
ResourceLabel = "resourceLabel"
},
PredefinedScalingMetricSpecification = new PredictiveScalingPredefinedScalingMetricProperty {
PredefinedMetricType = "predefinedMetricType",
// the properties below are optional
ResourceLabel = "resourceLabel"
}
};
Synopsis
Constructors
PredictiveScalingMetricSpecificationProperty() |
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()
public PredictiveScalingMetricSpecificationProperty()
Properties
CustomizedCapacityMetricSpecification
The customized capacity metric specification.
public object CustomizedCapacityMetricSpecification { get; set; }
Property Value
System.Object
Remarks
CustomizedLoadMetricSpecification
The customized load metric specification.
public object CustomizedLoadMetricSpecification { get; set; }
Property Value
System.Object
Remarks
CustomizedScalingMetricSpecification
The customized scaling metric specification.
public object CustomizedScalingMetricSpecification { get; set; }
Property Value
System.Object
Remarks
PredefinedLoadMetricSpecification
The predefined load metric specification.
public object PredefinedLoadMetricSpecification { get; set; }
Property Value
System.Object
Remarks
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
System.Object
Remarks
PredefinedScalingMetricSpecification
The predefined scaling metric specification.
public object PredefinedScalingMetricSpecification { get; set; }
Property Value
System.Object
Remarks
TargetValue
Specifies the target utilization.
public double TargetValue { get; set; }
Property Value
System.Double
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.