Exemplo n.º 1
0
        public async Task ReadAlarmsAreCreatedForEachTable()
        {
            var mockery   = new DynamoAlarmGeneratorMockery();
            var generator = mockery.AlarmGenerator;

            ConfigureTables(mockery);

            await generator.GenerateAlarmsFor(Config(), RunMode.GenerateAlarms);

            CloudwatchVerify.AlarmWasPutOnTable(mockery.Cloudwatch,
                                                alarmName: "test-a-table-ConsumedReadCapacityUnits-TestGroup",
                                                tableName: "test-a-table",
                                                metricName: "ConsumedReadCapacityUnits",
                                                threshold: 292500,
                                                period: 300);

            CloudwatchVerify.AlarmWasPutOnTable(mockery.Cloudwatch,
                                                alarmName: "test-a-table-ReadThrottleEvents-TestGroup",
                                                tableName: "test-a-table",
                                                metricName: "ReadThrottleEvents",
                                                threshold: 2,
                                                period: 60);

            CloudwatchVerify.AlarmWasNotPutOnMetric(mockery.Cloudwatch,
                                                    "ConsumedWriteCapacityUnits");
        }
        public void NoWriteAlarmIsPut()
        {
            var mockery = new DynamoAlarmGeneratorMockery();

            TestRun(mockery);

            CloudwatchVerify.AlarmWasNotPutOnMetric(mockery.Cloudwatch, "ConsumedWriteCapacityUnits");
        }
        public async Task NoWriteAlarmsAreCreated()
        {
            var mockery   = new DynamoAlarmGeneratorMockery();
            var generator = mockery.AlarmGenerator;

            ConfigureTables(mockery);

            await generator.GenerateAlarmsFor(Config(), RunMode.GenerateAlarms);

            CloudwatchVerify.AlarmWasNotPutOnMetric(mockery.Cloudwatch, "ConsumedWriteCapacityUnits");
        }