Remove the ImageSizePollster
We can use generator to achieve this purpose simply. Change-Id: Id05c33fb2aa89fd02035c717417d0181e975c3ec Signed-off-by: Yunhong, Jiang <yunhong.jiang@intel.com>
This commit is contained in:
parent
51c8a8e55c
commit
a801bdfb17
@ -96,12 +96,6 @@ class ImagePollster(_Base):
|
||||
timestamp=timeutils.isotime(),
|
||||
resource_metadata=self.extract_image_metadata(image),
|
||||
)
|
||||
|
||||
|
||||
class ImageSizePollster(_Base):
|
||||
|
||||
def get_counters(self, manager, context):
|
||||
for image in self.iter_images():
|
||||
yield counter.Counter(
|
||||
name='image.size',
|
||||
type=counter.TYPE_GAUGE,
|
||||
|
1
setup.py
1
setup.py
@ -119,7 +119,6 @@ setuptools.setup(
|
||||
[ceilometer.poll.central]
|
||||
network_floatingip = ceilometer.network.floatingip:FloatingIPPollster
|
||||
image = ceilometer.image.glance:ImagePollster
|
||||
image_size = ceilometer.image.glance:ImageSizePollster
|
||||
objectstore = ceilometer.objectstore.swift:SwiftPollster
|
||||
|
||||
[ceilometer.storage]
|
||||
|
@ -99,14 +99,9 @@ class TestImagePollster(base.TestCase):
|
||||
def test_glance_image_counter(self):
|
||||
counters = list(glance.ImagePollster().get_counters(self.manager,
|
||||
self.context))
|
||||
self.assertEqual(len(counters), 3)
|
||||
for counter in counters:
|
||||
self.assertEqual(len(counters), 6)
|
||||
for counter in [c for c in counters if c.name == 'image']:
|
||||
self.assertEqual(counter.volume, 1)
|
||||
|
||||
def test_glance_image_size_counter(self):
|
||||
counters = list(glance.ImageSizePollster().get_counters(self.manager,
|
||||
self.context))
|
||||
self.assertEqual(len(counters), 3)
|
||||
for image in IMAGE_LIST:
|
||||
self.assert_(
|
||||
any(map(lambda counter: counter.volume == image.size,
|
||||
|
Loading…
Reference in New Issue
Block a user