Hello All!
I’m calculating duration of some processes during a time period. That works well with help of
|> map(fn: (r) => ({r with state: if r._value >= 10 then "true" else "false"}))
|> stateTracking(fn: (r) => r.state=="true", durationColumn: "duration", durationUnit: 1h)
As a result I’m getting necessary values in hours.
Now I’d like to get percentage of the calculated values in correspondence with total period. So I need to get Hours values of selected period in Grafana and use something like Map from Influx in order to calculate the percentage. The question is how to get the selected period at all and in Hours?
PS. Influx itself doesn’t have any data math functions.