I am using InfluxQL language to extract data from InfluxDB. I want to get the duration when I have a variable with True value.
I have this on my database:
time running
2022-09-16 09:00:00 False
2022-09-16 09:05:00 False
2022-09-16 09:10:00 True
2022-09-16 09:40:00 True
2022-09-16 10:00:00 False
2022-09-16 12:00:00 True
2022-09-16 12:10:00 False
I want to get this result:
Duration True: 1h
1h = 50 min (09:10-10:00) + 10 min (12:00-12:10)
Can someone give me an advice with an InfluxQL query?
Thank you!