Hi Alberto,
Please see inline …

On Apr 14, 2015, at 10:34 AM, <[email protected]> <[email protected]> wrote:

> Dear all,
> 
> I want to have aggregations over the statistics but I don't know how to do 
> aggregations. I have a test query as follows:
> {
>    "end_time": "now",
>    "select_fields": [
>        "T", "cpu_info.cpu_share", "SUM(cpu_info.cpu_share)", 
> "cpu_info.one_min_cpuload", "UUID", "COUNT(cpu_info)”
[Megh]: When you select “T” you are requesting the actual samples and so the 
aggregations - SUM, COUNT will only happen on the single sample and hence. You 
can select “T=“ which is aggregations over a specific time period in seconds, 
and then the aggregations will give different values.

>    ],
>    "sort_fields": [],
>    "start_time": "now-60m",
>    "table": "StatTable.ComputeCpuState.cpu_info",
>    "where": [
>        [
>            {
>                "name": "Source",
>                "op": 1,
>                "suffix": null,
>                "value": "contrail",
>                "value2": null
>            }
>        ]
>    ]
> }
> 
> I send this query and I get around 12 instances with the information I 
> requested. However, the count is 1 in each instance and the SUM is equal to 
> de cpu_share (as it represents only 1 value). How can I have, for example, an 
> aggregation over 3 (i.e. a count equal to 3)? Is it configured somewhere in 
> contrail configuration?
[Megh]: As above.
> 
> Also, if you could provide me which kinds of aggregations are available I 
> would be grateful. Are they the same as the aggregations available at 
> Cassandra?
[Megh]: SUM, COUNT, MAX, MIN are the aggregations available. These are 
implemented on top of Cassandra and Cassandra might not offer the safe 
aggregations natively.

Thanks

Megh
> 
> Thank you for reading.
> 
> Best regards,
> Alberto.
> 
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.opencontrail.org/mailman/listinfo/users_lists.opencontrail.org


_______________________________________________
Users mailing list
[email protected]
http://lists.opencontrail.org/mailman/listinfo/users_lists.opencontrail.org

Reply via email to