Class: Brigade::Monitor::Fetcher
- Inherits:
-
Object
- Object
- Brigade::Monitor::Fetcher
- Defined in:
- lib/brigade/monitor/fetcher.rb
Instance Method Summary collapse
- #get_update ⇒ Object
-
#initialize(client, name, logger) ⇒ Fetcher
constructor
A new instance of Fetcher.
Constructor Details
#initialize(client, name, logger) ⇒ Fetcher
Returns a new instance of Fetcher.
6 7 8 9 10 |
# File 'lib/brigade/monitor/fetcher.rb', line 6 def initialize(client, name, logger) @client = client @name = name @log = logger end |
Instance Method Details
#get_update ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/brigade/monitor/fetcher.rb', line 12 def get_update version = @client.version summary = @client.summary devs = @client.devs pools = @client.pools # XXX check status replies on each command? update = host_info(summary, version) devs.body.each do |dev| if dev.has_key? 'GPU' update[:gpus] << gpu_info(dev) elsif dev.has_key? 'ASC' update[:asics] << asic_info(dev) elsif dev.has_key? 'PGA' update[:fpgas] << fpga_info(dev) else @log.warn("Skipped unknown device: #{dev}") end end pools.body.each do |pool| update[:pools] << pool_info(pool) end @log.debug("Built update: #{update}") update end |