我的数据库包含一天的每秒数据,当我尝试获取每 1 小时的平均记录时,时间总是从 01h 开始,但它应该从 00h 开始
我在 node.js 上使用 @influxdata/influxdb-client 库
怎么了?
我的查询
from(bucket: "${bucket}")
|> range(start: 2021-07-29T00:00:00Z, stop: 2021-07-29T23:59:59Z)
|> aggregateWindow(every: 1h, fn: mean)
|> pivot(
rowKey:["_time"],
columnKey: ["_field"],
valueColumn: "_value"
)`
我有
[
{
result: '_result',
table: 0,
_time: '2021-07-29T01:00:00Z', <--------------
_measurement: 'dash',
cpu: 3.158759124087591,
mem: 2.6091743119266053
},
{
result: '_result',
table: 0,
_time: '2021-07-29T02:00:00Z',
_measurement: 'dash',
cpu: 3.0807339449541282,
klima: 0,
priz: 0,
mem: 2.6091743119266053
},..........
我预计
[
{
result: '_result',
table: 0,
_time: '2021-07-29T00:00:00Z', <-------------
_measurement: 'dash',
cpu: 3.158759124087591,
mem: 2.6091743119266053
},
{
result: '_result',
table: 0,
_time: '2021-07-29T01:00:00Z',
_measurement: 'dash',
cpu: 3.0807339449541282,
klima: 0,
priz: 0,
mem: 2.6091743119266053
},..........