OpenTSDB / opentsdb

A scalable, distributed Time Series Database.
http://opentsdb.net
GNU Lesser General Public License v2.1
5k stars 1.25k forks source link

I set "useCalendar" to true, the result is error? #1043

Closed jyzhangbo closed 7 years ago

jyzhangbo commented 7 years ago

I used the endpoint "api/query",when the "useCalendar" is false, the query is:

{
     "start": "1498838400",
    "end": "1501516800",
    "timezone": "Asia/Shanghai",
    "useCalendar":false,
    "queries": [
        {
            "aggregator": "avg",
            "metric": "meter.energy.active.forward.z",
            "downsample": "1d-first-nan",
            "rate": false,
            "filters": [
                {
                    "type": "literal_or",
                    "tagk": "deviceId",
                    "filter": "127",
                    "groupBy": true
                }
            ]
        }
    ]
}

the result is :+1:

[{
   "metric": "meter.energy.active.forward.z",
   "tags":    {
      "deviceTypeId": "1",
      "deviceNo": "340340001750",
      "deviceId": "127",
      "gatewayId": "72"
   },
   "aggregateTags": [],
   "dps":    {
      "1498867200": "NaN",
      "1498953600": 0.029999999329447746,
      "1499040000": "NaN",
      "1499126400": 349577.59375,
      "1499212800": 444977.375,
      "1499299200": 547902.5625,
      "1499385600": 652058.25,
      "1499472000": 757900.375,
      "1499558400": 800983.75,....}}]

but when I set "useCalendar" to true ,the result is:

[{
   "metric": "meter.energy.active.forward.z",
   "tags":    {
      "deviceTypeId": "1",
      "deviceNo": "340340001750",
      "deviceId": "127",
      "gatewayId": "72"
   },
   "aggregateTags": [],
   "dps": {}
}]

Why the result dps is null, and what should I do to get the result?

manolama commented 7 years ago

Oops, I created #1050 for this. I have a fix and will push it in 2.3.1. Thanks!