Interface IMetricProps
Properties for a metric.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudWatch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IMetricProps : ICommonMetricOptions
Syntax (vb)
Public Interface IMetricProps Inherits ICommonMetricOptions
Remarks
ExampleMetadata: infused
Examples
// Create a metric
var metric = new Metric(new MetricProps {
Namespace = "AWS/EC2",
MetricName = "CPUUtilization",
Statistic = "Average",
Period = Duration.Hours(1)
});
// Create an anomaly detection alarm
var alarm = new AnomalyDetectionAlarm(this, "AnomalyAlarm", new AnomalyDetectionAlarmProps {
Metric = metric,
EvaluationPeriods = 1,
// Number of standard deviations for the band (default: 2)
StdDevs = 2,
// Alarm outside on either side of the band, or just below or above it (default: outside)
ComparisonOperator = ComparisonOperator.LESS_THAN_LOWER_OR_GREATER_THAN_UPPER_THRESHOLD,
AlarmDescription = "Alarm when metric is outside the expected band"
});
Synopsis
Properties
| MetricName | Name of the metric. |
| Namespace | Namespace of the metric. |
Properties
MetricName
Name of the metric.
string MetricName { get; }
Property Value
Remarks
ExampleMetadata: infused
Namespace
Namespace of the metric.
string Namespace { get; }
Property Value
Remarks
ExampleMetadata: infused