Search in sources :

Example 46 with PutMetricAlarmRequest

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

the class GtfsRtAlarmsImpl method createMessagesReceivedAlarm.

@Override
public void createMessagesReceivedAlarm() {
    String sqsQueue = _configService.getConfigurationValueAsString("alarm.sqsQueue", getEnv());
    PutMetricAlarmRequest putMetricAlarmRequest = getSQSMetricAlarmRequest(MetricName.NumberOfMessagesReceived, getSqsQueue());
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setInsufficientDataActions(getCriticalAction());
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.sqsNumMessagesReceived", 1d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 47 with PutMetricAlarmRequest

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

the class GtfsRtAlarmsImpl method createMessagesSentAlarm.

@Override
public void createMessagesSentAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getSQSMetricAlarmRequest(MetricName.NumberOfMessagesSent, getSqsQueue());
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setInsufficientDataActions(getCriticalAction());
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.sqsNumMessagesSent", 1d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 48 with PutMetricAlarmRequest

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

the class PredictionAlarmsImpl method createPredictablePercentageAlarm.

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

Example 49 with PutMetricAlarmRequest

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

the class PredictionAlarmsImpl method createProcessingTimeAlarm.

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

Example 50 with PutMetricAlarmRequest

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

the class PredictionAlarmsImpl method createPredictionTotalQueueLatencyAlarm.

@Override
public void createPredictionTotalQueueLatencyAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getMetricAlarmRequest(MetricName.PredictionTotalQueueLatency);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setInsufficientDataActions(getNonCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Count);
    putMetricAlarmRequest.setComparisonOperator(ComparisonOperator.LessThanOrEqualToThreshold);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.predictionTotalQueueLatency", 30000d));
    _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