Provide base method for inspect_memory_resident

The inspect_memory_resident was introduced a few months back.  When a
new inspector element is added, it should also be added to the base
inspector.  The base inspector should raise a NotImplementedError.

Due to this missing defintion, the pollster for the resident memory was
throwing an error for every instance that was sampled - if that
inspector did not have this method defined.

This change set adds a base definition, which removes the excessive
logging per instance when using a non-libvirt inspector.

Change-Id: Ibac8a18a3e84fb90763c48c892583d8d3785c91c
Closes-Bug: 1480309
This commit is contained in:
Drew Thorstensen 2015-07-31 09:43:30 -04:00
parent 29d3cd405b
commit 778b1b080f

View File

@ -244,6 +244,16 @@ class Inspector(object):
""" """
raise ceilometer.NotImplementedError raise ceilometer.NotImplementedError
def inspect_memory_resident(self, instance, duration=None):
"""Inspect the resident memory statistics for an instance.
:param instance: the target instance
:param duration: the last 'n' seconds, over which the value should be
inspected
:return: the amount of resident memory
"""
raise ceilometer.NotImplementedError
def inspect_disk_rates(self, instance, duration=None): def inspect_disk_rates(self, instance, duration=None):
"""Inspect the disk statistics as rates for an instance. """Inspect the disk statistics as rates for an instance.