Add memory.resident libvirt meter for Ceilometer

The 'memory.resident' metric will expose the
physical hosts view of the amount of host memory that is actually used to
run the VM process

DocImpact: https://review.openstack.org/#/c/164724

Change-Id: I9f2ad784479f234679e1145efd96d9d707dd19d0
Implements: blueprint memory-resident
This commit is contained in:
vivek.nandavanam
2015-03-13 11:00:37 -07:00
parent b5cfcb620c
commit a2c650b478
5 changed files with 106 additions and 1 deletions

View File

@@ -212,3 +212,8 @@ class LibvirtInspector(virt_inspector.Inspector):
physical=block_info[2])
yield (disk, info)
def inspect_memory_resident(self, instance, duration=None):
domain = self._get_domain_not_shut_off_or_raise(instance)
memory = domain.memoryStats()['rss'] / units.Ki
return virt_inspector.MemoryResidentStats(resident=memory)