Class MetricTargetTrackingProps
Properties for enabling tracking of an arbitrary metric.
Inheritance
Namespace: Amazon.CDK.AWS.AutoScaling
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class MetricTargetTrackingProps : Object, IMetricTargetTrackingProps, IBaseTargetTrackingProps
Syntax (vb)
Public Class MetricTargetTrackingProps
Inherits Object
Implements IMetricTargetTrackingProps, IBaseTargetTrackingProps
Remarks
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;
using Amazon.CDK.AWS.AutoScaling;
using Amazon.CDK.AWS.CloudWatch;
Metric metric;
var metricTargetTrackingProps = new MetricTargetTrackingProps {
Metric = metric,
TargetValue = 123,
// the properties below are optional
Cooldown = Duration.Minutes(30),
DisableScaleIn = false,
EstimatedInstanceWarmup = Duration.Minutes(30)
};
Synopsis
Constructors
MetricTargetTrackingProps() |
Properties
Cooldown | Period after a scaling completes before another scaling activity can start. |
DisableScaleIn | Indicates whether scale in by the target tracking policy is disabled. |
EstimatedInstanceWarmup | Estimated time until a newly launched instance can send metrics to CloudWatch. |
Metric | Metric to track. |
TargetValue | Value to keep the metric around. |
Constructors
MetricTargetTrackingProps()
public MetricTargetTrackingProps()
Properties
Cooldown
Period after a scaling completes before another scaling activity can start.
public Duration Cooldown { get; set; }
Property Value
Remarks
Default: - The default cooldown configured on the AutoScalingGroup.
DisableScaleIn
Indicates whether scale in by the target tracking policy is disabled.
public Nullable<bool> DisableScaleIn { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the autoscaling group. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the group.
Default: false
EstimatedInstanceWarmup
Estimated time until a newly launched instance can send metrics to CloudWatch.
public Duration EstimatedInstanceWarmup { get; set; }
Property Value
Remarks
Default: - Same as the cooldown.
Metric
Metric to track.
public IMetric Metric { get; set; }
Property Value
Remarks
The metric must represent a utilization, so that if it's higher than the target value, your ASG should scale out, and if it's lower it should scale in.
TargetValue
Value to keep the metric around.
public double TargetValue { get; set; }
Property Value
System.Double