dynamo-autoscale 0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +9 -0
- data/bin/dynamo-autoscale +4 -0
- data/dynamo-autoscale.gemspec +5 -0
- data/lib/dynamo-autoscale/actioner.rb +0 -4
- data/lib/dynamo-autoscale/dispatcher.rb +1 -2
- data/lib/dynamo-autoscale/version.rb +1 -1
- metadata +6 -3
data/CHANGELOG
ADDED
data/bin/dynamo-autoscale
CHANGED
@@ -77,6 +77,7 @@ require_relative '../config/environment/common'
|
|
77
77
|
include DynamoAutoscale
|
78
78
|
extend DynamoAutoscale
|
79
79
|
|
80
|
+
logger.debug "Ensuring tables exist in DynamoDB..."
|
80
81
|
dynamo = AWS::DynamoDB.new
|
81
82
|
tables.select! do |table_name|
|
82
83
|
if dynamo.tables[table_name].exists?
|
@@ -98,6 +99,7 @@ if general_opts[:dry_run]
|
|
98
99
|
poller_opts[:filters] = LocalActioner.faux_provisioning_filters
|
99
100
|
end
|
100
101
|
|
102
|
+
logger.debug "Assigning global objects..."
|
101
103
|
DynamoAutoscale.rules = RuleSet.new(ruleset)
|
102
104
|
DynamoAutoscale.dispatcher = Dispatcher.new
|
103
105
|
DynamoAutoscale.poller = CWPoller.new(poller_opts)
|
@@ -112,6 +114,7 @@ if general_opts[:maximum_throughput]
|
|
112
114
|
Actioner.maximum_throughput = general_opts[:maximum_throughput]
|
113
115
|
end
|
114
116
|
|
117
|
+
logger.debug "Registering signal handlers..."
|
115
118
|
Signal.trap("USR1") do
|
116
119
|
logger.info "[signal] Caught SIGUSR1. Dumping CSV for all tables in #{Dir.pwd}"
|
117
120
|
|
@@ -128,4 +131,5 @@ Signal.trap("USR2") do
|
|
128
131
|
end
|
129
132
|
end
|
130
133
|
|
134
|
+
logger.info "Finished setup. Starting polling loop."
|
131
135
|
DynamoAutoscale.poller.run
|
data/dynamo-autoscale.gemspec
CHANGED
@@ -18,6 +18,11 @@ Gem::Specification.new do |gem|
|
|
18
18
|
|
19
19
|
gem.license = 'MIT'
|
20
20
|
|
21
|
+
gem.required_ruby_version = '>= 1.9.3'
|
22
|
+
|
23
|
+
gem.requirements << "If you want to graph your tables, you'll need R with " +
|
24
|
+
"the ggplot and reshape packages installed."
|
25
|
+
|
21
26
|
gem.add_dependency 'aws-sdk'
|
22
27
|
gem.add_dependency 'rbtree'
|
23
28
|
gem.add_dependency 'ruby-prof'
|
@@ -158,10 +158,6 @@ module DynamoAutoscale
|
|
158
158
|
end
|
159
159
|
|
160
160
|
def queue_operation! metric, value
|
161
|
-
if @pending[metric]
|
162
|
-
logger.debug "[#{metric}] Overwriting pending op with #{value.round(2)}"
|
163
|
-
end
|
164
|
-
|
165
161
|
@pending[metric] = [Time.now.utc, value]
|
166
162
|
|
167
163
|
try_flush!
|
@@ -29,8 +29,7 @@ module DynamoAutoscale
|
|
29
29
|
DynamoAutoscale.rules.test(table)
|
30
30
|
@last_check[table.name] = time
|
31
31
|
else
|
32
|
-
logger.debug "
|
33
|
-
"a later data point."
|
32
|
+
logger.debug "Skipped rule check, already checked for a later data point."
|
34
33
|
end
|
35
34
|
|
36
35
|
DynamoAutoscale.current_table = nil
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamo-autoscale
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -100,6 +100,7 @@ extensions: []
|
|
100
100
|
extra_rdoc_files: []
|
101
101
|
files:
|
102
102
|
- .gitignore
|
103
|
+
- CHANGELOG
|
103
104
|
- Gemfile
|
104
105
|
- Gemfile.lock
|
105
106
|
- LICENSE
|
@@ -162,14 +163,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
162
163
|
requirements:
|
163
164
|
- - ! '>='
|
164
165
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
166
|
+
version: 1.9.3
|
166
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
168
|
none: false
|
168
169
|
requirements:
|
169
170
|
- - ! '>='
|
170
171
|
- !ruby/object:Gem::Version
|
171
172
|
version: '0'
|
172
|
-
requirements:
|
173
|
+
requirements:
|
174
|
+
- If you want to graph your tables, you'll need R with the ggplot and reshape packages
|
175
|
+
installed.
|
173
176
|
rubyforge_project:
|
174
177
|
rubygems_version: 1.8.23
|
175
178
|
signing_key:
|