Hello,
when executing a flux query with an aggregate window larger then the time window over the API on InfluxDBv2 the result contains two values. Eg:
Query:
from(bucket: “pix”)
|> range(start: -5m)
|> filter(fn: (r) => r["_measurement"] == “cpu”)
|> filter(fn: (r) => r["_field"] == “usage_user”)
|> filter(fn: (r) => r[“cpu”] == “cpu-total”)
|> filter(fn: (r) => r[“host”] == “example/.org”)
|> aggregateWindow(every: 5m, fn: mean, createEmpty: false)
Result:
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
,mean,0,2021-08-25T07:47:44.688052786Z,2021-08-25T07:52:44.688052786Z,2021-08-25T07:50:00Z,0.6062161745975281,usage_user,cpu,cpu-total,example/.org
,mean,0,2021-08-25T07:47:44.688052786Z,2021-08-25T07:52:44.688052786Z,2021-08-25T07:52:44.688052786Z,0.522318321504565,usage_user,cpu,cpu-total,example/.org
Setting the “every” param for aggregateWindow() to 1h returns only one value. Should not the query return only result ? If no, could this be accomplished by another function ?
Best regards,
skurtin