I wrote this code on InfluxDB UI:
from(bucket: "name_undisclosed")
|> range(start: -10h)
|> filter(fn: (r) => r["_measurement"] == "merge_requests")
|> filter(fn: (r) => r["_field"] == "state")
|> group(columns: ["project"])
|> stateDuration(fn: (r) => r.state == "merged", column: "duration", unit: 1s)
In the resulting table I get a column full of “-1” values but when I look at the actual database there are time gaps between the first opened and the merged state of a project. Is there anything I should add?
I Basically was trying to set up duration of the merged done in the GitHub. I tried different types of queries like filtering r.state == “opened” or r.state == “merged” but nothing worked. Please advice.
Chantal Deguire is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.