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

Thomas Maddox thomas.maddox at RACKSPACE.COM
Wed Aug 14 15:36:38 UTC 2013

On 8/14/13 10:29 AM, "Julien Danjou" <julien at danjou.info> wrote:

>On Wed, Aug 14 2013, Thomas Maddox wrote:
>> Am I misunderstanding the code? This looks like it's returning the first
>> sample's details:
>> _mongodb.py#L578-L584. When I change the metadata attribute's
>> 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!

Lol, understood. I'll roll that in with my bug fix since it's related. =]

>> That's definitely a good point; I didn't know that. I suppose if we
>> 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
>> 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

More information about the OpenStack-dev mailing list