Class CfnScalingPolicy.CustomizedMetricSpecificationProperty
Contains customized metric specification information for a target tracking scaling policy for Application Auto Scaling.
Inheritance
Namespace: Amazon.CDK.AWS.ApplicationAutoScaling
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CustomizedMetricSpecificationProperty : Object, CfnScalingPolicy.ICustomizedMetricSpecificationProperty
Syntax (vb)
Public Class CustomizedMetricSpecificationProperty
Inherits Object
Implements CfnScalingPolicy.ICustomizedMetricSpecificationProperty
Remarks
For information about the available metrics for a service, see AWS services that publish CloudWatch metrics in the Amazon CloudWatch User Guide .
To create your customized metric specification:
For an example of how creating new metrics can be useful, see Scaling based on Amazon SQS in the Amazon EC2 Auto Scaling User Guide . This topic mentions Auto Scaling groups, but the same scenario for Amazon SQS can apply to the target tracking scaling policies that you create for a Spot Fleet by using Application Auto Scaling.
For more information about the CloudWatch terminology below, see Amazon CloudWatch concepts .
CustomizedMetricSpecification
is a property of the AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingScalingPolicyConfiguration property type.
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.ApplicationAutoScaling;
var customizedMetricSpecificationProperty = new CustomizedMetricSpecificationProperty {
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} },
MetricName = "metricName",
Metrics = new [] { new TargetTrackingMetricDataQueryProperty {
Expression = "expression",
Id = "id",
Label = "label",
MetricStat = new TargetTrackingMetricStatProperty {
Metric = new TargetTrackingMetricProperty {
Dimensions = new [] { new TargetTrackingMetricDimensionProperty {
Name = "name",
Value = "value"
} },
MetricName = "metricName",
Namespace = "namespace"
},
Stat = "stat",
Unit = "unit"
},
ReturnData = false
} },
Namespace = "namespace",
Statistic = "statistic",
Unit = "unit"
};
Synopsis
Constructors
CustomizedMetricSpecificationProperty() |
Properties
Dimensions | The dimensions of the metric. |
MetricName | The name of the metric. |
Metrics | The metrics to include in the target tracking scaling policy, as a metric data query. |
Namespace | The namespace of the metric. |
Statistic | The statistic of the metric. |
Unit | The unit of the metric. |
Constructors
CustomizedMetricSpecificationProperty()
public CustomizedMetricSpecificationProperty()
Properties
Dimensions
The dimensions of the metric.
public object Dimensions { get; set; }
Property Value
System.Object
Remarks
Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.
MetricName
The name of the metric.
public string MetricName { get; set; }
Property Value
System.String
Remarks
To get the exact metric name, namespace, and dimensions, inspect the Metric object that's returned by a call to ListMetrics .
Metrics
The metrics to include in the target tracking scaling policy, as a metric data query.
public object Metrics { get; set; }
Property Value
System.Object
Remarks
This can include both raw metric and metric math expressions.
Namespace
The namespace of the metric.
public string Namespace { get; set; }
Property Value
System.String
Remarks
Statistic
The statistic of the metric.
public string Statistic { get; set; }
Property Value
System.String
Remarks
Unit
The unit of the metric.
public string Unit { get; set; }
Property Value
System.String
Remarks
For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference .