If you don't give the 'where' clause -- you get the below effect.. - Raj
On Apr 20, 2015, at 1:51 AM, [email protected] wrote: > Hi, > > Thanks for both replies. Worked perfectly. > > Now I have a related doubt: Is there any way to retrieve all the tuples from > the API without a where clause? (Using only the time restrictions) > > > Best regards, > Alberto. > > Quoting Raj Reddy <[email protected]>: > >> Hi Alberto, >> >> An example query is given below, one can get avg load every 9min for every >> system, using the query below.. [SUM(cpu_info.one_min_cpuload)/ >> COUNT(cpu_info)] >> >> regards, >> - >> Raj >> >> >> >> >> On Apr 14, 2015, at 1:21 PM, Megh Bhatt <[email protected]> >> wrote: >> >>> 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 >> >> > >
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ Users mailing list [email protected] http://lists.opencontrail.org/mailman/listinfo/users_lists.opencontrail.org
