Don't fail if graphite stats found for unconfigured pools

This commit is contained in:
Scott Schneider 2013-12-20 11:41:44 -08:00
parent 502ebcf8b0
commit 71d0cf2772

View file

@ -68,16 +68,19 @@ get '/dashboard/stats/vcloud/pool' do
history.each do |pool|
if pool['target'] =~ /.*\.(.*)$/
pool['name'] = $1
pool['last'] = result[pool['name']]['size']
result[pool['name']]['history'] ||= Array.new
pool['datapoints'].each do |metric|
8.times do |n|
if ( metric[0] )
pool['last'] = metric[0].to_i
result[pool['name']]['history'].push( metric[0].to_i )
else
result[pool['name']]['history'].push( pool['last'] )
if ( result[pool['name']] )
pool['last'] = result[pool['name']]['size']
result[pool['name']]['history'] ||= Array.new
pool['datapoints'].each do |metric|
8.times do |n|
if ( metric[0] )
pool['last'] = metric[0].to_i
result[pool['name']]['history'].push( metric[0].to_i )
else
result[pool['name']]['history'].push( pool['last'] )
end
end
end
end