Module: NimbleNodes::Dynos
- Defined in:
- lib/nimble_nodes/dynos.rb
Class Method Summary collapse
-
.[](key) ⇒ Object
shortcut for accessing NimbleNodes.settings[key].
- .max ⇒ Object
- .max_request_queue ⇒ Object
- .min ⇒ Object
- .min_request_queue ⇒ Object
-
.monitor(env) ⇒ Object
pass over the hash containing Rack env variables a Report will be created and posted if neccessary.
-
.monitor? ⇒ Boolean
Monitoring.
-
.paused? ⇒ Boolean
Status Inspector.
- .request_queue ⇒ Object
- .settings ⇒ Object
- .size ⇒ Object
Class Method Details
.[](key) ⇒ Object
shortcut for accessing NimbleNodes.settings[key]
8 9 10 |
# File 'lib/nimble_nodes/dynos.rb', line 8 def self.[](key) NimbleNodes::Dynos.settings[key] end |
.max ⇒ Object
25 26 27 |
# File 'lib/nimble_nodes/dynos.rb', line 25 def self.max NimbleNodes::Dynos['max'] end |
.max_request_queue ⇒ Object
38 39 40 |
# File 'lib/nimble_nodes/dynos.rb', line 38 def self.max_request_queue NimbleNodes::Dynos.request_queue['max'] end |
.min ⇒ Object
21 22 23 |
# File 'lib/nimble_nodes/dynos.rb', line 21 def self.min NimbleNodes::Dynos['min'] end |
.min_request_queue ⇒ Object
34 35 36 |
# File 'lib/nimble_nodes/dynos.rb', line 34 def self.min_request_queue NimbleNodes::Dynos.request_queue['min'] end |
.monitor(env) ⇒ Object
pass over the hash containing Rack env variables a Report will be created and posted if neccessary
57 58 59 60 61 62 63 64 |
# File 'lib/nimble_nodes/dynos.rb', line 57 def self.monitor(env) begin report = NimbleNodes::Report.new(env) report.post if report.post? rescue # rescues any possible errors to ensure app performace isn't affected end end |
.monitor? ⇒ Boolean
Monitoring
50 51 52 |
# File 'lib/nimble_nodes/dynos.rb', line 50 def self.monitor? NimbleNodes.active? and !NimbleNodes::Dynos.paused? end |
.paused? ⇒ Boolean
Status Inspector
44 45 46 |
# File 'lib/nimble_nodes/dynos.rb', line 44 def self.paused? not NimbleNodes::Dynos['paused_at'].nil? end |
.request_queue ⇒ Object
29 30 31 32 |
# File 'lib/nimble_nodes/dynos.rb', line 29 def self.request_queue hash = NimbleNodes::Dynos.settings['request_queue'] hash.nil? ? {} : hash end |
.settings ⇒ Object
12 13 14 15 |
# File 'lib/nimble_nodes/dynos.rb', line 12 def self.settings hash = NimbleNodes::Settings['dynos_pool'] hash.nil? ? {} : hash end |
.size ⇒ Object
17 18 19 |
# File 'lib/nimble_nodes/dynos.rb', line 17 def self.size NimbleNodes::Dynos['size'] end |