Selectable aggregation functions on statistics queries

Registered by Eoghan Glynn

Currently, all statistcs queries return *all* available aggregates, i.e. the results of the standard set of aggregation functions: avg, sum, min, max, count.

This is acceptable for a limited set of aggregates, there's not necessarily much additional computation overhead involved and in some cases the calculation of one aggregate naturally "falls out" of another (e.g. count from average).

However as the range of aggregates becomes wider, e.g. to include more expensive functions such as percentiles, then it would be better to also the API caller specify which aggregate functions they're interested in.

One way of doing so would be via the WSME query mechanism, using 'aggregate' as a distinguished field, e.g.:

  /v2/meter/cpu/statistics?q.field=aggregate&q.op=eq&q.value=max,stddev,count

The API contract would be such that some super-set of the requested aggregate functions are returned. In the case where pre-aggregated values are available for the appropriate scope, periodicity etc., then more aggregates than requested may be returned (i.e. there wouldn't be a great need to scrub these data of unrequested aggregate values). Where one of more of the requested aggregates are unsupported, then this would be indicated via a 400 Bad Request response with an appropriate log message.

Blueprint information

Status:
Complete
Approver:
Julien Danjou
Priority:
Medium
Drafter:
Eoghan Glynn
Direction:
Approved
Assignee:
Eoghan Glynn
Definition:
Approved
Series goal:
Accepted for icehouse
Implementation:
Implemented
Milestone target:
milestone icon 2014.1
Started by
Eoghan Glynn
Completed by
Julien Danjou

Related branches

Sprints

Whiteboard

WIP patch: https://review.openstack.org/70454

Addressed by: https://review.openstack.org/76273
    Add simple capabilities API

Addressed by: https://review.openstack.org/76878
    Selectable aggregate support in mongodb

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.