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
signature.asc
Description: PGP signature
_______________________________________________ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev