Search in sources :

Example 56 with PutMetricAlarmRequest

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

the class RealtimeAlarmsImpl method createRealtimeTripsUnmatchedAlarm.

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

Example 57 with PutMetricAlarmRequest

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

the class WebappAlarmsImpl method createVehicleMonitoringAlarm.

@Override
public void createVehicleMonitoringAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getMetricAlarmRequest(MetricName.VehicleMonitoringErrorResponse);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Count);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.webVehicleMonitoringError", 1d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 58 with PutMetricAlarmRequest

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

the class WebappAlarmsImpl method createNextBusApiAlarm.

@Override
public void createNextBusApiAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getMetricAlarmRequest(MetricName.NextBusApiErrorResponse);
    putMetricAlarmRequest.setThreshold(1d);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Count);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.webNextBusApiError", 1d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 59 with PutMetricAlarmRequest

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

the class AdminServiceAlarmsImpl method createFirstValidBundleFilesCountAlarm.

@Override
public void createFirstValidBundleFilesCountAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getMetricAlarmRequest(MetricName.FirstValidBundleFilesCount);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Count);
    putMetricAlarmRequest.setComparisonOperator(ComparisonOperator.LessThanThreshold);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.bundleFilesCount", 1d));
    _cloudWatchService.publishAlarm(putMetricAlarmRequest);
}
Also used : PutMetricAlarmRequest(com.amazonaws.services.cloudwatch.model.PutMetricAlarmRequest)

Example 60 with PutMetricAlarmRequest

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

the class AdminServiceAlarmsImpl method createCurrentBundleCountAlarm.

@Override
public void createCurrentBundleCountAlarm() {
    PutMetricAlarmRequest putMetricAlarmRequest = getMetricAlarmRequest(MetricName.CurrentBundleCount);
    putMetricAlarmRequest.setAlarmActions(getCriticalAction());
    putMetricAlarmRequest.setUnit(StandardUnit.Count);
    putMetricAlarmRequest.setComparisonOperator(ComparisonOperator.LessThanThreshold);
    putMetricAlarmRequest.setThreshold(_configService.getConfigurationValueAsDouble("alarm.bundleCount", 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