Class: What::Modules::What
- Inherits:
-
Base
- Object
- Base
- What::Modules::What
show all
- Defined in:
- lib/what/modules/what.rb
Instance Attribute Summary
Attributes inherited from Base
#interval
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #name, #status
Instance Method Details
#check! ⇒ Object
11
12
13
14
15
|
# File 'lib/what/modules/what.rb', line 11
def check!
@config.map do |name, uri|
Helpers.curl(uri) { |body| @whats[name] = JSON.parse(body) rescue nil }
end
end
|
#details ⇒ Object
21
22
23
|
# File 'lib/what/modules/what.rb', line 21
def details
@whats
end
|
#health ⇒ Object
17
18
19
|
# File 'lib/what/modules/what.rb', line 17
def health
Helpers.overall_health(@whats.map { |_, attrs| attrs['health'] })
end
|
#initialize_module ⇒ Object
4
5
6
7
8
9
|
# File 'lib/what/modules/what.rb', line 4
def initialize_module
@config.each do |name, host|
@config[name] = "http://#{host}:9428"
end
@whats = {}
end
|