Class: AppHealth::Checker
- Inherits:
-
Object
- Object
- AppHealth::Checker
- Defined in:
- lib/apphealth/checker.rb
Instance Attribute Summary collapse
-
#servers ⇒ Object
Returns the value of attribute servers.
-
#threads ⇒ Object
Returns the value of attribute threads.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(url = nil) ⇒ Checker
constructor
A new instance of Checker.
- #run ⇒ Object
Constructor Details
Instance Attribute Details
#servers ⇒ Object
Returns the value of attribute servers.
3 4 5 |
# File 'lib/apphealth/checker.rb', line 3 def servers @servers end |
#threads ⇒ Object
Returns the value of attribute threads.
3 4 5 |
# File 'lib/apphealth/checker.rb', line 3 def threads @threads end |
#uri ⇒ Object
Returns the value of attribute uri.
3 4 5 |
# File 'lib/apphealth/checker.rb', line 3 def uri @uri end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/apphealth/checker.rb', line 15 def run servers.select(&:unchecked?).each do |server| threads << Thread.new do server.check(uri) end end threads.each(&:join) self end |