mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
Don't display 'lifetime' or 'running' metrics if VM has been destroyed
This commit is contained in:
parent
91563c0408
commit
97d4c4a7ee
1 changed files with 5 additions and 2 deletions
|
|
@ -452,8 +452,11 @@ module Vmpooler
|
|||
result[params[:hostname]] = {}
|
||||
|
||||
result[params[:hostname]]['template'] = rdata['template']
|
||||
result[params[:hostname]]['lifetime'] = rdata['lifetime'] || $config[:config]['vm_lifetime']
|
||||
result[params[:hostname]]['running'] = ((Time.now - Time.parse($redis.hget('vmpooler__active__' + result[params[:hostname]]['template'], params[:hostname]))) / 60 / 60).round(2)
|
||||
|
||||
unless rdata['destroy']
|
||||
result[params[:hostname]]['lifetime'] = rdata['lifetime'] || $config[:config]['vm_lifetime']
|
||||
result[params[:hostname]]['running'] = ((Time.now - Time.parse($redis.hget('vmpooler__active__' + result[params[:hostname]]['template'], params[:hostname]))) / 60 / 60).round(2)
|
||||
end
|
||||
|
||||
rdata.keys.each do |key|
|
||||
if key.match('^tag\:(.+?)$')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue