Search in sources :

Example 41 with PutMetricAlarmRequest

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

the class DatabaseAlarmsImpl method createRdsHighCPUAlarm.

@Override
public void createRdsHighCPUAlarm(String dbInstance) {
    PutMetricAlarmRequest putMetricAlarmRequest = getRDSMetricAlarmRequest(MetricName.CPUUtilization, "RdsHighCPU", dbInstance);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Count);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.dbCPUUtilization", 75d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 42 with PutMetricAlarmRequest

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

the class DatabaseAlarmsImpl method createRdsWriteLatencyAlarm.

@Override
public void createRdsWriteLatencyAlarm(String dbInstance) {
    PutMetricAlarmRequest putMetricAlarmRequest = getRDSMetricAlarmRequest(MetricName.WriteLatency, "RdsWriteLatency", dbInstance);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Count);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.dbWriteLatency", 0.3d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 43 with PutMetricAlarmRequest

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

the class DatabaseAlarmsImpl method createRdsHighConnectionsAlarm.

@Override
public void createRdsHighConnectionsAlarm(String dbInstance) {
    PutMetricAlarmRequest putMetricAlarmRequest = getRDSMetricAlarmRequest(MetricName.DatabaseConnections, "RdsHighConnections", dbInstance);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Count);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.dbHighConnections", 400d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 44 with PutMetricAlarmRequest

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

the class GtfsRtAlarmsImpl method createMessagesSizeAlarm.

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

Example 45 with PutMetricAlarmRequest

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

the class GtfsRtAlarmsImpl method createMessagesDeletedAlarm.

@Override
public void createMessagesDeletedAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getSQSMetricAlarmRequest(MetricName.NumberOfMessagesDeleted, getSqsQueue());
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setInsufficientDataActions(getCriticalAction());
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.sqsNumMessagesDeleted", 1d));
    _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