@Stability(value=Stable)
public static interface CfnScalingPolicy.MetricStatProperty
extends software.amazon.jsii.JsiiSerializable
This structure defines the CloudWatch metric to return, along with the statistic, period, and unit.
For more information about the CloudWatch terminology below, see Amazon CloudWatch concepts in the Amazon CloudWatch User Guide .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.autoscaling.*;
MetricStatProperty metricStatProperty = MetricStatProperty.builder()
.metric(MetricProperty.builder()
.metricName("metricName")
.namespace("namespace")
// the properties below are optional
.dimensions(List.of(MetricDimensionProperty.builder()
.name("name")
.value("value")
.build()))
.build())
.stat("stat")
// the properties below are optional
.unit("unit")
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
CfnScalingPolicy.MetricStatProperty.Builder
A builder for
CfnScalingPolicy.MetricStatProperty |
static class |
CfnScalingPolicy.MetricStatProperty.Jsii$Proxy
An implementation for
CfnScalingPolicy.MetricStatProperty |
| Modifier and Type | Method and Description |
|---|---|
static CfnScalingPolicy.MetricStatProperty.Builder |
builder() |
Object |
getMetric()
The CloudWatch metric to return, including the metric name, namespace, and dimensions.
|
String |
getStat()
The statistic to return.
|
default String |
getUnit()
The unit to use for the returned data points.
|
@Stability(value=Stable) @NotNull Object getMetric()
To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics .
@Stability(value=Stable) @NotNull String getStat()
It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide .
The most commonly used metrics for predictive scaling are Average and Sum .
@Stability(value=Stable) @Nullable default String getUnit()
For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference .
@Stability(value=Stable) static CfnScalingPolicy.MetricStatProperty.Builder builder()
Copyright © 2022. All rights reserved.