mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Don't fail if graphite stats found for unconfigured pools
This commit is contained in:
parent
e3080a432d
commit
36cc7ea3fe
1 changed files with 12 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue