mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Pool stats should still work without graphite
This commit is contained in:
parent
c795880535
commit
45ab2455cf
1 changed files with 22 additions and 15 deletions
|
|
@ -59,6 +59,7 @@ get '/dashboard/stats/vcloud/pool' do
|
||||||
end
|
end
|
||||||
|
|
||||||
if ( params[:history] )
|
if ( params[:history] )
|
||||||
|
if ( config[:config]['graphite'] )
|
||||||
history ||= Hash.new
|
history ||= Hash.new
|
||||||
|
|
||||||
buffer = open( 'http://'+config[:config]['graphite']+'/render?target=vcloud.ready.*&from=-1hour&format=json' ).read
|
buffer = open( 'http://'+config[:config]['graphite']+'/render?target=vcloud.ready.*&from=-1hour&format=json' ).read
|
||||||
|
|
@ -82,6 +83,12 @@ get '/dashboard/stats/vcloud/pool' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
config[:pools].each do |pool|
|
||||||
|
result[pool['name']] ||= Hash.new
|
||||||
|
result[pool['name']]['history'] = [ $redis.scard( 'vmware_host_pool__ready__' + pool['name'] ) ]
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
content_type :json
|
content_type :json
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue