dynamo-autoscale 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/lib/dynamo-autoscale/rule.rb +8 -0
- data/lib/dynamo-autoscale/rule_set.rb +11 -2
- data/lib/dynamo-autoscale/version.rb +1 -1
- metadata +1 -1
data/CHANGELOG
CHANGED
@@ -174,6 +174,14 @@ module DynamoAutoscale
|
|
174
174
|
message
|
175
175
|
end
|
176
176
|
|
177
|
+
def reads?
|
178
|
+
@metric == :consumed_reads
|
179
|
+
end
|
180
|
+
|
181
|
+
def writes?
|
182
|
+
@metric == :consumed_writes
|
183
|
+
end
|
184
|
+
|
177
185
|
def serialize
|
178
186
|
metric = @metric == :consumed_reads ? "reads" : "writes"
|
179
187
|
|
@@ -19,9 +19,18 @@ module DynamoAutoscale
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def test table
|
22
|
-
|
23
|
-
|
22
|
+
result = false
|
23
|
+
rules = self.for(table.name)
|
24
|
+
|
25
|
+
rules.select(&:reads?).each do |rule|
|
26
|
+
break result = true if rule.test(table)
|
27
|
+
end
|
28
|
+
|
29
|
+
rules.select(&:writes?).each do |rule|
|
30
|
+
break result = true if rule.test(table)
|
24
31
|
end
|
32
|
+
|
33
|
+
result
|
25
34
|
end
|
26
35
|
|
27
36
|
def table table_name, &block
|