mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
First-pass at a 'running VMs' graph
This commit is contained in:
parent
fa3486a0ca
commit
78818c4a56
3 changed files with 148 additions and 0 deletions
|
|
@ -110,6 +110,21 @@ get '/dashboard/stats/vcloud/pool' do
|
|||
JSON.pretty_generate(result)
|
||||
end
|
||||
|
||||
get '/dashboard/stats/vcloud/running' do
|
||||
result = Hash.new
|
||||
|
||||
config[:pools].each do |pool|
|
||||
running = $redis.scard( 'vmware_host_pool__running__' + pool['name'] )
|
||||
|
||||
pool['major'] = $1 if pool['name'] =~ /^(\w+)\-/
|
||||
|
||||
result[pool['major']] = result[pool['major']].to_i + running.to_i
|
||||
end
|
||||
|
||||
content_type :json
|
||||
JSON.pretty_generate(result)
|
||||
end
|
||||
|
||||
get '/status' do
|
||||
content_type :json
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue