opentsdb api / query下采样结果不正确

时间:2017-08-08 08:25:06

标签: opentsdb

我使用API​​ /查询下采样来查询数据,但我得到的结果是不同的。我无法解释原因。

我的第一个问题:

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

结果:

    [{
       "metric": "meter.energy.active.forward.z",
       "tags":    {
          "deviceTypeId": "1",
          "deviceNo": "340340001750",
          "deviceId": "127",
          "gatewayId": "72"
       },
       "aggregateTags": [],
       "dps":    {
          "1498924800": 0.029999999329447746,
          "1499097600": 349577.59375,
          "1499184000": 410578.90625,
          "1499270400": 515834.09375,
          "1499356800": 616553.6875,
          "1499443200": 722792.5,
          "1499529600": 800983.75...}}]

对于第二个请求,我只将24h-first更改为24h-first-nan,第二个请求结果为:

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

我希望结果是:

[{
           "metric": "meter.energy.active.forward.z",
           "tags":    {
              "deviceTypeId": "1",
              "deviceNo": "340340001750",
              "deviceId": "127",
              "gatewayId": "72"
           },
           "aggregateTags": [],
           "dps":    {
              "1498924800": 0.029999999329447746,
              "1499011200": NaN,
              "1499097600": 349577.59375,
              "1499184000": 410578.90625,
              "1499270400": 515834.09375,
              "1499356800": 616553.6875,
              "1499443200": 722792.5,
              "1499529600": 800983.75...}}]

我也删除了“useCalendar”,但时间不是我想要的。

你看到我的问题了吗?你能帮我吗?谢谢!

0 个答案:

没有答案