Loading cloudcontrol/node/hypervisor/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ class Handler(HostHandler): # we must refresh those tags only when domains tags are registered to # have the calculated values for tag in ('cpualloc', 'cpurunning', 'cpuremaining', 'memalloc', 'memrunning', 'memremaining'): for tag in ('cpualloc', 'cpurunning', 'cpuremaining', 'cpuallocratio', 'memalloc', 'memrunning', 'memremaining'): self.tag_db['__main__'][tag].update_value() # register libvirt handlers Loading cloudcontrol/node/hypervisor/tags.py +8 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,14 @@ def cpuremaining(handl): return cpu - cpualloc @_check_virt_connected def cpuallocratio(handl): """Allocated CPU ratio on the hypervisor.""" cpu = float(handl.tag_db['__main__']['cpu'].value) cpualloc = float(handl.tag_db['__main__']['cpualloc'].value) return '%0.2f' % (cpualloc / cpu) @_check_virt_connected def memrunning(handl): """Memory used by running VMs on the hypervisor.""" Loading Loading
cloudcontrol/node/hypervisor/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ class Handler(HostHandler): # we must refresh those tags only when domains tags are registered to # have the calculated values for tag in ('cpualloc', 'cpurunning', 'cpuremaining', 'memalloc', 'memrunning', 'memremaining'): for tag in ('cpualloc', 'cpurunning', 'cpuremaining', 'cpuallocratio', 'memalloc', 'memrunning', 'memremaining'): self.tag_db['__main__'][tag].update_value() # register libvirt handlers Loading
cloudcontrol/node/hypervisor/tags.py +8 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,14 @@ def cpuremaining(handl): return cpu - cpualloc @_check_virt_connected def cpuallocratio(handl): """Allocated CPU ratio on the hypervisor.""" cpu = float(handl.tag_db['__main__']['cpu'].value) cpualloc = float(handl.tag_db['__main__']['cpualloc'].value) return '%0.2f' % (cpualloc / cpu) @_check_virt_connected def memrunning(handl): """Memory used by running VMs on the hypervisor.""" Loading