Interface MetricStatConfig
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
MetricStatConfig.Jsii$Proxy
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:33.358Z")
@Stability(Stable)
public interface MetricStatConfig
extends software.amazon.jsii.JsiiSerializable
Properties for a concrete metric.
NOTE: unit is no longer on this object since it is only used for Alarms, and doesn't mean what one
would expect it to mean there anyway. It is most likely to be misused.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.cloudwatch.*;
Object value;
MetricStatConfig metricStatConfig = MetricStatConfig.builder()
.metricName("metricName")
.namespace("namespace")
.period(Duration.minutes(30))
.statistic("statistic")
// the properties below are optional
.account("account")
.accountOverride("accountOverride")
.dimensions(List.of(Dimension.builder()
.name("name")
.value(value)
.build()))
.region("region")
.regionOverride("regionOverride")
.unitFilter(Unit.SECONDS)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forMetricStatConfigstatic final classAn implementation forMetricStatConfig -
Method Summary
Modifier and TypeMethodDescriptionstatic MetricStatConfig.Builderbuilder()default StringAccount which this metric comes from.default StringAccount set directly on the metric, not inherited from the attached stack.The dimensions to apply to the alarm.Name of the metric.Namespace of the metric.How many seconds to aggregate over.default StringRegion which this metric comes from.default StringRegion set directly on the metric, not inherited from the attached stack.Aggregation function to use (can be either simple or a percentile).default UnitUnit used to filter the metric stream.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getMetricName
Name of the metric. -
getNamespace
Namespace of the metric. -
getPeriod
How many seconds to aggregate over. -
getStatistic
Aggregation function to use (can be either simple or a percentile). -
getAccount
Account which this metric comes from.Default: Deployment account.
-
getAccountOverride
Account set directly on the metric, not inherited from the attached stack.Default: No override.
-
getDimensions
The dimensions to apply to the alarm.Default: []
-
getRegion
Region which this metric comes from.Default: Deployment region.
-
getRegionOverride
Region set directly on the metric, not inherited from the attached stack.Default: No override.
-
getUnitFilter
Unit used to filter the metric stream.Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.
This field has been renamed from plain
unitto clearly communicate its purpose.Default: - Refer to all metric datums
-
builder
- Returns:
- a
MetricStatConfig.BuilderofMetricStatConfig
-