Class MetricStatConfig.Builder
java.lang.Object
software.amazon.awscdk.services.cloudwatch.MetricStatConfig.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<MetricStatConfig>
- Enclosing interface:
MetricStatConfig
@Stability(Stable)
public static final class MetricStatConfig.Builder
extends Object
implements software.amazon.jsii.Builder<MetricStatConfig>
A builder for
MetricStatConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofMetricStatConfig.getAccount()
accountOverride
(String accountOverride) Sets the value ofMetricStatConfig.getAccountOverride()
build()
Builds the configured instance.dimensions
(List<? extends Dimension> dimensions) Sets the value ofMetricStatConfig.getDimensions()
metricName
(String metricName) Sets the value ofMetricStatConfig.getMetricName()
Sets the value ofMetricStatConfig.getNamespace()
Sets the value ofMetricStatConfig.getPeriod()
Sets the value ofMetricStatConfig.getRegion()
regionOverride
(String regionOverride) Sets the value ofMetricStatConfig.getRegionOverride()
Sets the value ofMetricStatConfig.getStatistic()
unitFilter
(Unit unitFilter) Sets the value ofMetricStatConfig.getUnitFilter()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
metricName
Sets the value ofMetricStatConfig.getMetricName()
- Parameters:
metricName
- Name of the metric. This parameter is required.- Returns:
this
-
namespace
Sets the value ofMetricStatConfig.getNamespace()
- Parameters:
namespace
- Namespace of the metric. This parameter is required.- Returns:
this
-
period
Sets the value ofMetricStatConfig.getPeriod()
- Parameters:
period
- How many seconds to aggregate over. This parameter is required.- Returns:
this
-
statistic
Sets the value ofMetricStatConfig.getStatistic()
- Parameters:
statistic
- Aggregation function to use (can be either simple or a percentile). This parameter is required.- Returns:
this
-
account
Sets the value ofMetricStatConfig.getAccount()
- Parameters:
account
- Account which this metric comes from.- Returns:
this
-
accountOverride
Sets the value ofMetricStatConfig.getAccountOverride()
- Parameters:
accountOverride
- Account set directly on the metric, not inherited from the attached stack.- Returns:
this
-
dimensions
Sets the value ofMetricStatConfig.getDimensions()
- Parameters:
dimensions
- The dimensions to apply to the alarm.- Returns:
this
-
region
Sets the value ofMetricStatConfig.getRegion()
- Parameters:
region
- Region which this metric comes from.- Returns:
this
-
regionOverride
Sets the value ofMetricStatConfig.getRegionOverride()
- Parameters:
regionOverride
- Region set directly on the metric, not inherited from the attached stack.- Returns:
this
-
unitFilter
Sets the value ofMetricStatConfig.getUnitFilter()
- Parameters:
unitFilter
- 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
unit
to clearly communicate its purpose.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<MetricStatConfig>
- Returns:
- a new instance of
MetricStatConfig
- Throws:
NullPointerException
- if any required attribute was not provided
-