[openstack-dev] [gnocchi][rating] Issues regarding gnocchi support in CloudKitty

Stéphane Albert sheeprine at nullplace.com
Thu Nov 26 16:23:28 UTC 2015


On Thu, Nov 26, 2015 at 05:04:02PM +0100, Julien Danjou wrote:
> On Thu, Nov 26 2015, Stéphane Albert wrote:
> 
> Here a first reply about resource handling.
> 
> > Resource data
> > =============
> > Duplicated resource informations from ceilometer, only revision timestamps
> > changing.
> 
> So I guess that's a bug in Gnocchi, we should not create new revision if
> there is 0 change. Would you mind opening a bug?
I'll open a bug with a full history dump, sometime it's due to the host
changing (flapping) from name to hash, this might be due to ceilometer.
But most of the time there is no change.
> 
> > Search for active instances during a timeframe
> > ==============================================
> 
> […]
> 
> > Here the revision is outside of the requested timeframe.
> 
> I don't get that comment. You didn't ask for any specific revision, you
> asked for a start/end timestamps. So that looks correct to me. You get
> the instances that was active between 10:33 and 17:33.
I didn't ask for a specific revision because I can't ;)
I get the list of instances active from 10:33 to 17:33, but with the
latest metadata which can be 2 or 3 days from the timeframe requested.
When you are doing rating based on metadata it's problematic.
> 
> > Same request with a filter on the revision
> > ==========================================
> 
> […]
> 
> > Empty response because the filter is not matching with the latest resource
> > revision.
> 
> Yes, that's normal too.
> 
> Revision are about resources modification.
> You don't need to search based on revision if you want to retrieve
> active resources during a timeframe. Just started_at/ended_at.
See above.

> 
> > Workaround
> > ==========
> > Search for every resource of type 'instances' active during the timeframe. The
> > generic request is just to reduce the amount of data transfered as its
> > useless.
> 
> I don't see what you are working around. You get _exactly_ the same
> result that you got with "Search for active instances during a
> timeframe" so what's the problem in the first place?
I do this to get the id of active instances. So I can then query gnocchi
for the correct revision filtering on the id.
> 
> > Request the correct revision from the resource_id we found before.
> 
> I don't understand what you call a "correct revision".
The correct revision is the revision matching the timeframe (10:33 to
17:33). So I can get the metadata that were applying to the instance in
this timeframe.
> 
> If what you want is the list of active resource during a timeframe and
> their revision within that timeframe, you can just do:
> 
> POST http://10.8.8.168:8041/v1/search/resource/instance?history=true
> {
>     "and": [
>         {
>             "or": [
>                 {
>                     "=": {
>                         "ended_at": null
>                     }
>                 },
>                 {
>                     ">=": {
>                         "ended_at": "2015-11-23T10:33:26.388112+00:00"
>                     }
>                 }
>             ]
>         },
>         {
>             "or": [
>                 {
>                     "=": {
>                         "ended_at": null
>                     }
>                 },
>                 {
>                     "<=": {
>                         "ended_at": "2015-11-23T17:33:26.388112+00:00"
>                     }
>                 }
>             ]
>         },
>         {
>             "<=": {
>                 "started_at": "2015-11-23T17:33:26.388112+00:00"
>             }
>         },
>         {
>             "<=": {
>                 "revision_start": "2015-11-23T17:33:26.388112+00:00"
>             }
>         }
>     ]
> }
If there is more than one revision, then I'll get multiple revisions for
a resource. This imply that you request all the revisions and then
filter them client side. It's not the most efficient way to proceed as
it could be directly done in the DB query.

Thanks for taking time to answer Julien.



More information about the OpenStack-dev mailing list