Search in sources :

Example 51 with PutMetricAlarmRequest

use of com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest in project onebusaway-application-modules by camsys.

the class RealtimeAlarmsImpl method createRealtimeStopsUnmatchedPctAlarm.

@Override
public void createRealtimeStopsUnmatchedPctAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getMetricAlarmRequest(MetricName.RealtimeStopsUnmatchedPct);
    putMetricAlarmRequest.setAlarmActions(getNonCriticalAction());
    putMetricAlarmRequest.setInsufficientDataActions(getNonCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Percent);
    putMetricAlarmRequest.setComparisonOperator(ComparisonOperator.LessThanOrEqualToThreshold);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.rtStopsUnmatchedPct", 0d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 52 with PutMetricAlarmRequest

use of com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest in project onebusaway-application-modules by camsys.

the class RealtimeAlarmsImpl method createRealtimeStopsMatchedAlarm.

@Override
public void createRealtimeStopsMatchedAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getMetricAlarmRequest(MetricName.RealtimeStopsMatched);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setInsufficientDataActions(getNonCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Count);
    putMetricAlarmRequest.setComparisonOperator(ComparisonOperator.LessThanOrEqualToThreshold);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.rtStopsMatched", 0d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 53 with PutMetricAlarmRequest

use of com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest in project onebusaway-application-modules by camsys.

the class RealtimeAlarmsImpl method createRealtimeBusesInServiceAlarm.

@Override
public void createRealtimeBusesInServiceAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getMetricAlarmRequest(MetricName.RealtimeBusesInServicePct);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setInsufficientDataActions(getNonCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Percent);
    putMetricAlarmRequest.setComparisonOperator(ComparisonOperator.LessThanOrEqualToThreshold);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.rtBusesInServicePct", 0d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 54 with PutMetricAlarmRequest

use of com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest in project onebusaway-application-modules by camsys.

the class RealtimeAlarmsImpl method createRealtimeLocationsInvalidAlarm.

@Override
public void createRealtimeLocationsInvalidAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getMetricAlarmRequest(MetricName.RealtimeLocationsInvalid);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setInsufficientDataActions(getNonCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Count);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.rtLocationsInvalid", 30d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 55 with PutMetricAlarmRequest

use of com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest in project onebusaway-application-modules by camsys.

the class RealtimeAlarmsImpl method createRealtimeTripsTotalAlarm.

@Override
public void createRealtimeTripsTotalAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getMetricAlarmRequest(MetricName.RealtimeTripsTotal);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setInsufficientDataActions(getNonCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Count);
    putMetricAlarmRequest.setComparisonOperator(ComparisonOperator.LessThanOrEqualToThreshold);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.rtTripsTotal", 0d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Aggregations

PutMetricAlarmRequest (com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)60 Test (org.junit.Test)9 Dimension (com.amazonaws.services.cloudwatch.model.Dimension)5 ArrayList (java.util.ArrayList)4 AmazonCloudWatch (com.amazonaws.services.cloudwatch.AmazonCloudWatch)1 DescribeAlarmsResult (com.amazonaws.services.cloudwatch.model.DescribeAlarmsResult)1 PutMetricAlarmResult (com.amazonaws.services.cloudwatch.model.PutMetricAlarmResult)1 LoadBalancer (com.amazonaws.services.elasticbeanstalk.model.LoadBalancer)1 DBInstance (com.amazonaws.services.rds.model.DBInstance)1 LinkedList (java.util.LinkedList)1