Addresses: BP selectable-aggregates
Previously, the statistics API always computed and returned a
standard set of aggregate functions.
Now, individual aggregation functions can be selected and even
parameterized via syntax of form:
/v2/meters/<meter_name>/statistics?aggregate.func=<name>&aggregate.param=<value>
For example in order to calculate the average CPU util only:
GET /v2/meters/cpu_util/statistics?aggregate.func=avg
HTTP/1.0 200 OK
[{"aggregate": {"avg": 0.6858829535841072},
"avg": 0.6858829535841072,
"duration_start": "2014-01-30T11:13:23",
"duration_end": "2014-01-31T16:07:13",
"duration": 104030.0,
"period": 0,
"period_start": "2014-01-30T11:13:23",
"period_end": "2014-01-31T16:07:13",
"groupby": null,
"unit": "%"}]
In the current patch, selectable aggregates are provided by the
sqlalchemy driver only, with support in the mongodb driver to
follow in a subsequent patch.
Change-Id: I6cc095ba5ae16dea3f6b404e72a070ab9ac49c9a