mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
(maint) Add the last boot time for each pool
This commit add a redis hash where there is one key per pool, and the stored value is the last time a VM was booted e.g. the last time a VM went from 'pending' to 'ready'. This is also displayed in the API as lastBoot:'2018-03-23 17:43:39 +0000'. The data can then be used by any external system, in this case our alarming system.
This commit is contained in:
parent
d57fc72fdb
commit
10245321bf
3 changed files with 22 additions and 11 deletions
|
|
@ -205,17 +205,19 @@ module Vmpooler
|
|||
result[:pools] = {} unless views and not views.include?("pools")
|
||||
pools.each do |pool|
|
||||
# REMIND: move this out of the API and into the back-end
|
||||
ready = backend.scard('vmpooler__ready__' + pool['name']).to_i
|
||||
running = backend.scard('vmpooler__running__' + pool['name']).to_i
|
||||
pending = backend.scard('vmpooler__pending__' + pool['name']).to_i
|
||||
max = pool['size']
|
||||
aka = pool['alias']
|
||||
ready = backend.scard('vmpooler__ready__' + pool['name']).to_i
|
||||
running = backend.scard('vmpooler__running__' + pool['name']).to_i
|
||||
pending = backend.scard('vmpooler__pending__' + pool['name']).to_i
|
||||
max = pool['size']
|
||||
lastBoot = backend.hget('vmpooler__lastboot',pool['name']).to_s
|
||||
aka = pool['alias']
|
||||
|
||||
result[:pools][pool['name']] = {
|
||||
ready: ready,
|
||||
running: running,
|
||||
pending: pending,
|
||||
max: max
|
||||
ready: ready,
|
||||
running: running,
|
||||
pending: pending,
|
||||
max: max,
|
||||
lastBoot: lastBoot
|
||||
}
|
||||
|
||||
if aka
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue