@Generated(value="com.amazonaws:awsjavasdkcodegenerator") public class CustomizedMetricSpecification extends Object implements Serializable, Cloneable
Represents a CloudWatch metric of your choosing for a target tracking scaling policy to use with Amazon EC2 Auto Scaling.
To create your customized metric specification:
Add values for each required property from CloudWatch. You can use an existing metric, or a new metric that you create. To use your own metric, you must first publish the metric to CloudWatch. For more information, see Publish custom metrics in the Amazon CloudWatch User Guide.
Choose a metric that changes proportionally with capacity. The value of the metric should increase or decrease in inverse proportion to the number of capacity units. That is, the value of the metric should decrease when capacity increases.
For more information about the CloudWatch terminology below, see Amazon CloudWatch concepts.
Each individual service provides information about the metrics, namespace, and dimensions they use. For more information, see Amazon Web Services services that publish CloudWatch metrics in the Amazon CloudWatch User Guide.
Constructor and Description 

CustomizedMetricSpecification() 
Modifier and Type  Method and Description 

CustomizedMetricSpecification 
clone() 
boolean 
equals(Object obj) 
List<MetricDimension> 
getDimensions()
The dimensions of the metric.

String 
getMetricName()
The name of the metric.

List<TargetTrackingMetricDataQuery> 
getMetrics()
The metrics to include in the target tracking scaling policy, as a metric data query.

String 
getNamespace()
The namespace of the metric.

String 
getStatistic()
The statistic of the metric.

String 
getUnit()
The unit of the metric.

int 
hashCode() 
void 
setDimensions(Collection<MetricDimension> dimensions)
The dimensions of the metric.

void 
setMetricName(String metricName)
The name of the metric.

void 
setMetrics(Collection<TargetTrackingMetricDataQuery> metrics)
The metrics to include in the target tracking scaling policy, as a metric data query.

void 
setNamespace(String namespace)
The namespace of the metric.

void 
setStatistic(MetricStatistic statistic)
The statistic of the metric.

void 
setStatistic(String statistic)
The statistic of the metric.

void 
setUnit(String unit)
The unit of the metric.

String 
toString()
Returns a string representation of this object.

CustomizedMetricSpecification 
withDimensions(Collection<MetricDimension> dimensions)
The dimensions of the metric.

CustomizedMetricSpecification 
withDimensions(MetricDimension... dimensions)
The dimensions of the metric.

CustomizedMetricSpecification 
withMetricName(String metricName)
The name of the metric.

CustomizedMetricSpecification 
withMetrics(Collection<TargetTrackingMetricDataQuery> metrics)
The metrics to include in the target tracking scaling policy, as a metric data query.

CustomizedMetricSpecification 
withMetrics(TargetTrackingMetricDataQuery... metrics)
The metrics to include in the target tracking scaling policy, as a metric data query.

CustomizedMetricSpecification 
withNamespace(String namespace)
The namespace of the metric.

CustomizedMetricSpecification 
withStatistic(MetricStatistic statistic)
The statistic of the metric.

CustomizedMetricSpecification 
withStatistic(String statistic)
The statistic of the metric.

CustomizedMetricSpecification 
withUnit(String unit)
The unit of the metric.

public void setMetricName(String metricName)
The name of the metric. To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics.
metricName
 The name of the metric. To get the exact metric name, namespace, and dimensions, inspect the Metric object
that is returned by a call to ListMetrics.public String getMetricName()
The name of the metric. To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics.
public CustomizedMetricSpecification withMetricName(String metricName)
The name of the metric. To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics.
metricName
 The name of the metric. To get the exact metric name, namespace, and dimensions, inspect the Metric object
that is returned by a call to ListMetrics.public void setNamespace(String namespace)
The namespace of the metric.
namespace
 The namespace of the metric.public String getNamespace()
The namespace of the metric.
public CustomizedMetricSpecification withNamespace(String namespace)
The namespace of the metric.
namespace
 The namespace of the metric.public List<MetricDimension> getDimensions()
The dimensions of the metric.
Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.
Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.
public void setDimensions(Collection<MetricDimension> dimensions)
The dimensions of the metric.
Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.
dimensions
 The dimensions of the metric.
Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.
public CustomizedMetricSpecification withDimensions(MetricDimension... dimensions)
The dimensions of the metric.
Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.
NOTE: This method appends the values to the existing list (if any). Use
setDimensions(java.util.Collection)
or withDimensions(java.util.Collection)
if you want to
override the existing values.
dimensions
 The dimensions of the metric.
Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.
public CustomizedMetricSpecification withDimensions(Collection<MetricDimension> dimensions)
The dimensions of the metric.
Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.
dimensions
 The dimensions of the metric.
Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.
public void setStatistic(String statistic)
The statistic of the metric.
statistic
 The statistic of the metric.MetricStatistic
public String getStatistic()
The statistic of the metric.
MetricStatistic
public CustomizedMetricSpecification withStatistic(String statistic)
The statistic of the metric.
statistic
 The statistic of the metric.MetricStatistic
public void setStatistic(MetricStatistic statistic)
The statistic of the metric.
statistic
 The statistic of the metric.MetricStatistic
public CustomizedMetricSpecification withStatistic(MetricStatistic statistic)
The statistic of the metric.
statistic
 The statistic of the metric.MetricStatistic
public void setUnit(String unit)
The unit of the metric. For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference.
unit
 The unit of the metric. For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference.public String getUnit()
The unit of the metric. For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference.
public CustomizedMetricSpecification withUnit(String unit)
The unit of the metric. For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference.
unit
 The unit of the metric. For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference.public List<TargetTrackingMetricDataQuery> getMetrics()
The metrics to include in the target tracking scaling policy, as a metric data query. This can include both raw metric and metric math expressions.
public void setMetrics(Collection<TargetTrackingMetricDataQuery> metrics)
The metrics to include in the target tracking scaling policy, as a metric data query. This can include both raw metric and metric math expressions.
metrics
 The metrics to include in the target tracking scaling policy, as a metric data query. This can include
both raw metric and metric math expressions.public CustomizedMetricSpecification withMetrics(TargetTrackingMetricDataQuery... metrics)
The metrics to include in the target tracking scaling policy, as a metric data query. This can include both raw metric and metric math expressions.
NOTE: This method appends the values to the existing list (if any). Use
setMetrics(java.util.Collection)
or withMetrics(java.util.Collection)
if you want to override
the existing values.
metrics
 The metrics to include in the target tracking scaling policy, as a metric data query. This can include
both raw metric and metric math expressions.public CustomizedMetricSpecification withMetrics(Collection<TargetTrackingMetricDataQuery> metrics)
The metrics to include in the target tracking scaling policy, as a metric data query. This can include both raw metric and metric math expressions.
metrics
 The metrics to include in the target tracking scaling policy, as a metric data query. This can include
both raw metric and metric math expressions.public String toString()
toString
in class Object
Object.toString()
public CustomizedMetricSpecification clone()