Search in sources :

Example 16 with PutMetricAlarmRequest

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

the class PredictionAlarmsImpl method createDeserializeQueueSizeAlarm.

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

Example 17 with PutMetricAlarmRequest

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

the class PredictionAlarmsImpl method createPredictionTotalLatencyAlarm.

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

Example 18 with PutMetricAlarmRequest

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

the class RealtimeAlarmsImpl method createRealtimeStopsMatchedPctAlarm.

@Override
public void createRealtimeStopsMatchedPctAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getMetricAlarmRequest(MetricName.RealtimeStopsMatchedPct);
    putMetricAlarmRequest.setAlarmActions(getNonCriticalAction());
    putMetricAlarmRequest.setInsufficientDataActions(getNonCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Percent);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.rtStopsMatchedPct", 10d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 19 with PutMetricAlarmRequest

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

the class RealtimeAlarmsImpl method createRealtimeTripsMatchedAvgAlarm.

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

Example 20 with PutMetricAlarmRequest

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

the class RealtimeAlarmsImpl method createRealtimeStopsUnmatchedAlarm.

@Override
public void createRealtimeStopsUnmatchedAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getMetricAlarmRequest(MetricName.RealtimeStopsUnmatched);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setInsufficientDataActions(getNonCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Count);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.rtStopsUnmatched", // about 4-5%
    300d));
    _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