Example usage for com.amazonaws.services.cloudwatch.model MetricAlarm getMetricName

List of usage examples for com.amazonaws.services.cloudwatch.model MetricAlarm getMetricName

Introduction

In this page you can find the example usage for com.amazonaws.services.cloudwatch.model MetricAlarm getMetricName.

Prototype


public String getMetricName() 

Source Link

Document

The name of the metric associated with the alarm, if this is an alarm based on a single metric.

Usage

From source file:com.netflix.spinnaker.clouddriver.ecs.services.EcsCloudMetricService.java

License:Apache License

private PutMetricAlarmRequest buildPutMetricAlarmRequest(MetricAlarm metricAlarm, String serviceName,
        Set<String> insufficientActionPolicyArns, Set<String> okActionPolicyArns,
        Set<String> alarmActionPolicyArns) {
    return new PutMetricAlarmRequest().withAlarmName(metricAlarm.getAlarmName() + "-" + serviceName)
            .withEvaluationPeriods(metricAlarm.getEvaluationPeriods()).withThreshold(metricAlarm.getThreshold())
            .withActionsEnabled(metricAlarm.getActionsEnabled())
            .withAlarmDescription(metricAlarm.getAlarmDescription())
            .withComparisonOperator(metricAlarm.getComparisonOperator())
            .withDimensions(metricAlarm.getDimensions()).withMetricName(metricAlarm.getMetricName())
            .withUnit(metricAlarm.getUnit()).withPeriod(metricAlarm.getPeriod())
            .withNamespace(metricAlarm.getNamespace()).withStatistic(metricAlarm.getStatistic())
            .withEvaluateLowSampleCountPercentile(metricAlarm.getEvaluateLowSampleCountPercentile())
            .withTreatMissingData(metricAlarm.getTreatMissingData())
            .withExtendedStatistic(metricAlarm.getExtendedStatistic())
            .withInsufficientDataActions(insufficientActionPolicyArns).withOKActions(okActionPolicyArns)
            .withAlarmActions(alarmActionPolicyArns);
}