[openstack-dev] [Ceilometer] Concerning get_resources/get_meters and the Ceilometer API

Julien Danjou julien at danjou.info
Wed Aug 14 15:29:27 UTC 2013


On Wed, Aug 14 2013, Thomas Maddox wrote:

> Am I misunderstanding the code? This looks like it's returning the first
> sample's details: 
> https://github.com/openstack/ceilometer/blob/master/ceilometer/storage/impl
> _mongodb.py#L578-L584. When I change the metadata attribute's aggregation
> function from $first to $last, I get the latest state of the resource,
> which corrects the bug I'm working on. Otherwise, a newly built instance
> sits in a 'scheduling' state, according to the API call
> (https://bugs.launchpad.net/ceilometer/+bug/1208547).

Haha! I'm pretty sure it used to be last. The aggregate() function is
recent, so that may be a regression that we didn't catch. Anyway the
intention is last, not first.
I blame missing tests!

> That's definitely a good point; I didn't know that. I suppose if we wanted
> to make this API change, it'd have to be 'who owns it currently' as part
> of the contract for what details are returned. The event body or samples
> can give the historical details when desired. From a billing perspective,
> it'd be good to know ownership over time in order to bill appropriately
> for binary ownership billing rather than usage. Hmmmm...

Yes… I admit we stuck to very simple case and assumptions in the API.
There's a lot of corner case we aren't handling correctly, but it never
mattered so far. We're trying to get better at it. As I already stated
at some point, we need more test for this corner case and more fixes. :)

-- 
Julien Danjou
# Free Software hacker # freelance consultant
# http://julien.danjou.info
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130814/55cfe2c6/attachment.pgp>


More information about the OpenStack-dev mailing list