dynamo-autoscale 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/README.md +3 -3
- data/lib/dynamo-autoscale/actioner.rb +4 -1
- data/lib/dynamo-autoscale/rule.rb +1 -1
- data/lib/dynamo-autoscale/version.rb +1 -1
- data/templates/scale_report_email.erb +1 -1
- metadata +1 -1
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -225,15 +225,15 @@ The `table` argument is a `TableTracker` object. For a run down of what
|
|
225
225
|
information is available to you I advise checking out the source code in
|
226
226
|
`lib/dynamo-autoscale/table_tracker.rb`.
|
227
227
|
|
228
|
-
### The :
|
228
|
+
### The :times option
|
229
229
|
|
230
|
-
The `:
|
230
|
+
The `:times` option allows you to specify that a rule must be triggered a set
|
231
231
|
number of times in a row before its action is executed.
|
232
232
|
|
233
233
|
Example:
|
234
234
|
|
235
235
|
``` ruby
|
236
|
-
writes for: 10.minutes, greater_than: "90%",
|
236
|
+
writes for: 10.minutes, greater_than: "90%", times: 3, scale: { on: :consumed, by: 1.5 }
|
237
237
|
```
|
238
238
|
|
239
239
|
This says that is writes are greater than 90% for 10 minutes three checks in a
|
@@ -130,10 +130,13 @@ module DynamoAutoscale
|
|
130
130
|
logger.info "[#{metric}][scaling up] " +
|
131
131
|
"#{from ? from.round(2) : "Unknown"} -> #{to.round(2)}"
|
132
132
|
|
133
|
+
now = Time.now.utc
|
133
134
|
|
134
135
|
# Because upscales are not limited, we don't need to queue this operation.
|
135
136
|
if result = scale(metric, to)
|
136
|
-
|
137
|
+
table.scale_events[now] = { metric => to }
|
138
|
+
|
139
|
+
@provisioned[metric][now] = to
|
137
140
|
@upscales += 1
|
138
141
|
ScaleReport.new(table).send
|
139
142
|
end
|
@@ -118,7 +118,7 @@ module DynamoAutoscale
|
|
118
118
|
if @opts[:times].nil? or @count[table.name] == @opts[:times]
|
119
119
|
@count[table.name] = 0
|
120
120
|
logger.info "[rule] Triggered rule: #{self.to_english}"
|
121
|
-
table.triggered_rules[
|
121
|
+
table.triggered_rules[table.latest_data_time] = self
|
122
122
|
|
123
123
|
if scale = @opts[:scale]
|
124
124
|
new_val = table.send("last_#{scale[:on]}_for", @metric) * scale[:by]
|