我正在使用 TSI rest API 来获取聚合数据,当我以一个月的间隔(“P1M”)请求多个月的数据时,它返回的数据绘制不一致。以下是我的请求和回复,
要求
{
"aggregateSeries": {
"interval": "P1M",
"searchSpan": {
"from": "2020-11-01T00:00:00Z",
"to": "2020-12-31T23:59:59.999Z"
},
"timeSeriesId": [
"MyTSIId"
],
"projectedVariables": [
"ResultSet"
],
"inlineVariables": {
"ResultSet": {
"kind": "numeric",
"value": {
"tsx": "$event.MyData.Double"
},
"filter": null,
"interpolation": null,
"aggregation": {
"tsx": "avg($value)"
},
"categories": null,
"defaultCategory": null
}
}
}
}
回复
{
"timestamps": [
"2020-10-03T00:00:00Z",
"2020-11-02T00:00:00Z",
"2020-12-02T00:00:00Z"
],
"properties": [
{
"values": [
null,
2.8,
null
],
"name": "ResultSet",
"type": "Double"
}
],
"progress": 100.0
}
如果您查看 TSI 响应,它会返回 3 条记录,因为我只请求了 2 个月的数据,并且还绘制了从随机日期开始的月份,它既不绘制月份的开始,也不基于 searchSpan 中的起始日期。
+-----------------------------------------------------+
| TSI Response Plotting | Expected Response Plotting |
+-----------------------------------------------------+
| "2020-10-03T00:00:00Z" | "2020-11-01T00:00:00Z" |
| "2020-11-02T00:00:00Z" | "2020-12-01T00:00:00Z" |
| "2020-12-02T00:00:00Z" | |
+-----------------------------------------------------+
是否有可能从 TSI 获得预期的响应,或者是否有任何解决方法,感谢任何帮助。