Hi Albert,

If you specify the start_time and end_time in UTC time format, then please
specify it as integer and not as string.
"start_time": ³1432131330502589² => "start_time": 1432131330502589

"end_time": ³1432131421676206² => ³end_time²: 1432131421676206

And for your second question,
When ³T=<x>² is specified in the ³select_fields², then the value of ³T="
=> start_time + (N*x), where N >= 0 and T <= end_time

Thanks,
Sundar

On 5/20/15, 8:15 PM, "[email protected]" <[email protected]> wrote:

>Hi Sundaresan,
>
>There are matching entries and if you ask for SUM and you set T (no
>aggregation) it returns the aggregation for 1 element (same as asking
>for normal attributes but with extra information (count)).
>
>I have done a test with a proper contrail table.
>
>I issue the following query:
>{
>     "end_time": "now",
>     "select_fields": [
>         "T", "cpu_info.mem_virt", "cpu_info.cpu_share"
>     ],
>     "sort_fields": [],
>     "start_time": "now-2m",
>     "table": "StatTable.AnalyticsCpuState.cpu_info",
>     "where": [
>         [
>             {
>                 "name": "Source",
>                 "op": 1,
>                 "suffix": null,
>                 "value": "mgmt01",
>                 "value2": null
>             }
>         ]
>     ]
>}
>
>
>Which returns the following:
>{
>     "value": [
>         {
>             "T": 1432131330502589,
>             "cpu_info.cpu_share": 0,
>             "cpu_info.mem_virt": 247720
>         },
>         {
>             "T": 1432131346917530,
>             "cpu_info.cpu_share": 0.258333,
>             "cpu_info.mem_virt": 697880
>         },
>         {
>             "T": 1432131361675782,
>             "cpu_info.cpu_share": 0.00208333,
>             "cpu_info.mem_virt": 716132
>         },
>         {
>             "T": 1432131390605063,
>             "cpu_info.cpu_share": 0,
>             "cpu_info.mem_virt": 247720
>         },
>         {
>             "T": 1432131406922257,
>             "cpu_info.cpu_share": 0.289535,
>             "cpu_info.mem_virt": 697880
>         },
>         {
>             "T": 1432131421676206,
>             "cpu_info.cpu_share": 0.0270833,
>             "cpu_info.mem_virt": 716132
>         }
>     ]
>}
>
>With the timestamps of the first and the last message I create the
>following query (same as previous but changing end and start time):
>
>{
>     "end_time": "1432131421676206",
>     "select_fields": [
>         "T", "cpu_info.mem_virt", "cpu_info.cpu_share"
>     ],
>     "sort_fields": [],
>     "start_time": "1432131330502589",
>     "table": "StatTable.AnalyticsCpuState.cpu_info",
>     "where": [
>         [
>             {
>                 "name": "Source",
>                 "op": 1,
>                 "suffix": null,
>                 "value": "mgmt01",
>                 "value2": null
>             }
>         ]
>     ]
>}
>
>And I get this:
>{
>     "value": []
>}
>
>>> Also a related question, How are the timestamp of aggregations
>calculated? Is it the min, max or average?
>>> [Sundar] ?T? in ?select_fields? indicates individual time sample =>
>>> No aggregation
>I was refering to how is the timestamp for each aggregation
>calculated. For example: {
>     "value": [
>         {
>             "COUNT(cpu_info)": 2,
>             "SUM(cpu_info.cpu_share)": 0.560325,
>             "SUM(cpu_info.mem_virt)": 3075744,
>             "T=": 1432132000000000
>         },
>         {
>             "COUNT(cpu_info)": 4,
>             "SUM(cpu_info.cpu_share)": 0,
>             "SUM(cpu_info.mem_virt)": 247720,
>             "T=": 1432132100000000
>         }
>     ]
>}
>
>How is the value of T= calculated?
>
>Thanks for your support.
>Best regards,
>Alberto.
>
>Quoting Sundaresan Rajangam <[email protected]>:
>
>> Hi Alberto,
>>
>> Please see in line.
>>
>>> Date: Tue, 19 May 2015 17:44:10 +0200
>>> From: [email protected]
>>> To: [email protected]
>>> Subject: [Users] Querying API with timestamps
>>> Message-ID: <[email protected]>
>>> Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes";
>>>     format="flowed"
>>>
>>> Hi,
>>>
>>> I'm having troubles when using timestamps while querying the API using
>>>POST.
>>> I got the timestamp of a previous message as reference (the eldest of
>>> a previous query) for start_time and tried to do the following query
>>> (The table we are querying is a working table from a custom sandesh
>>> message):
>>> {
>>>  "start_time": "1432045370076142",
>>>  "sort_fields": [],
>>>  "end_time": "now",
>>>  "table": "StatTable.CDNAgent.QoSInfo",
>>>  "select_fields": ["Source", "name", "T", "QoSInfo.cache_id",
>>> "SUM(QoSInfo.service_quality)", "SUM(QoSInfo.hit_ratio)",
>>> "COUNT(QoSInfo)"],
>>>  "where": [[{"value2": null, "suffix": null, "name": "name", "value":
>>> "CDNDataAgent", "op": 1}]]
>>> }
>>>
>>> Then the result we got was empty. Why is this happening?
>> [Sundar] No matching entry/stat for name=?CDNDataAgent? [where
>> clause] in the CDNAgent.QosInfo stat table for the specified
>> start_time and end_time.
>> Please verify if the value specified for name in the where clause is
>> correct and/or the start_time/end_time is correct.
>>
>>> Also a related question, How are the timestamp of aggregations
>>> calculated? Is it the min, max or average?
>> [Sundar] ?T? in ?select_fields? indicates individual time sample =>
>> No aggregation
>>> We are currently using OpenContrail 2.10.
>>>
>> Thanks,
>> Sundar
>>>
>>> Best Regards,
>>> Alberto.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------
>>>
>>> Subject: Digest Footer
>>>
>>> _______________________________________________
>>> Users mailing list
>>> [email protected]
>>> 
>>>http://lists.opencontrail.org/mailman/listinfo/users_lists.opencontrail.
>>>org
>>>
>>>
>>> ------------------------------
>>>
>>> End of Users Digest, Vol 21, Issue 9
>>> ************************************
>>
>> _______________________________________________
>> Users mailing list
>> [email protected]
>> 
>>http://lists.opencontrail.org/mailman/listinfo/users_lists.opencontrail.o
>>rg
>>
>
>


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

Reply via email to