I'm trying to write some stats queries on devices, such as motor running hours, valve strokes etc.
One query that I'm wondering about is getting the number of motor starts in an hour, but that hour window does not necessarily align to the clock. E.g. were there instances were a motor started more than 6 times in a given 60 minute window?
The CountOn aggregation on an hour interval would give me the number of starts, but would miss these trains if they occurred about the hour mark.
All I can think of currently is to retrieve all the On events, and look for 6 more at timestamp+60 minutes. This seems computationally expensive.
Is there a more elegant approach?