Add groupby aggregation function

Bug #1573023 reported by Sergio Colinas
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Gnocchi
Fix Released
Wishlist
Julien Danjou

Bug Description

When you aggregate measures using groupby, you can't specify an aggregation function for the grouping aggregation (it will use the same as the measures).

For example, if you want to get the average memory usage groupby project in a month, you'll need the sum of each instance average memory usage.

If you use sum you will get the sum of each instance memory usage for each min granularity in a month, this will duplicate the measures and the result will be wrong. If you use mean, you will get the average instance memory usage, not the project average.

Julien Danjou (jdanjou)
Changed in gnocchi:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Julien Danjou (jdanjou) wrote :

I'm not sure I understand. If you want to the average memory usage of instances of a project, you just aggregate the 'mean' of all instances grouped by projects.

So asking the aggregation of 'mean' for instances/memory grouped by project should give you a list of the average of each project' instances memory usage over different period of time. You then just need to re-average that yourself is needed.

What do I miss?

Changed in gnocchi:
status: Triaged → Incomplete
Revision history for this message
Sergio Colinas (sergio-n) wrote :

Hi Julien,

I think there are two different aggregation functions. On the one hand you have the aggregation function of the data itself (specified in the archive policy), and in the other hand the one used for the group by. You should be able to combine them in the way you need.

For example, if you have two instances in a project, one using 1gb average and the other 2gb. If you ask for 'mean' you will get 1.5gb.

Instead of that I would like to get the sum of the average which is 3gb but I can only specify one aggregation method.

Revision history for this message
Sergio Colinas (sergio-n) wrote :

Hi Julien,

Did you understand the issue? I think it should be pretty easy to add this feature in gnocchi and it will give us the ability to query the measures using independent aggregation functions for group by and raw data aggregation.

Revision history for this message
Julien Danjou (jdanjou) wrote :

Understood, changed the status to triaged! Thanks Sergio!

Changed in gnocchi:
status: Incomplete → Triaged
Julien Danjou (jdanjou)
Changed in gnocchi:
assignee: nobody → Julien Danjou (jdanjou)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to gnocchi (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/350043

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to gnocchi (master)

Reviewed: https://review.openstack.org/350043
Committed: https://git.openstack.org/cgit/openstack/gnocchi/commit/?id=c13a21a8ae693adb4ff2f25bbf4d1908c0eb84dc
Submitter: Jenkins
Branch: master

commit c13a21a8ae693adb4ff2f25bbf4d1908c0eb84dc
Author: Julien Danjou <email address hidden>
Date: Tue Aug 2 15:16:56 2016 +0200

    storage: allow to specify regaggregation over aggregation retrieval

    Currently, when retrieving e.g. 'mean' aggregation of several metrics,
    the aggregation of those metrics is always done using 'mean'.
    This patches allows to specify a reaggregation methods, which applies on
    top of the measures retrieved.

    You can know retrieve e.g. the 'max' of the 'mean' of several metrics.

    Related-Bug: #1573023
    Change-Id: I9ea60de498e6f81c738a7236a392019b47b0c269

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to gnocchi (master)

Fix proposed to branch: master
Review: https://review.openstack.org/352023

Changed in gnocchi:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to gnocchi (master)

Reviewed: https://review.openstack.org/352023
Committed: https://git.openstack.org/cgit/openstack/gnocchi/commit/?id=82509d782e8a21d70a848065f4948f98419aca54
Submitter: Jenkins
Branch: master

commit 82509d782e8a21d70a848065f4948f98419aca54
Author: Julien Danjou <email address hidden>
Date: Sat Aug 6 15:48:17 2016 +0200

    rest: allow to specify reaggregation methods in aggregation

    Change-Id: Ib37c6b7e8b8214bd8b3e8f2e92547fed56923374
    Closes-Bug: #1573023

Changed in gnocchi:
status: In Progress → Fix Committed
Julien Danjou (jdanjou)
Changed in gnocchi:
milestone: none → 3.0.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.