We are getting ON|OFF data from a sensor. The ON is indicated by 1 and OFF as ‘0’. The data sample is:
We need to summarize these data for monitoring OFF duration.
For example : Start_time, End_Time. I was exploring ways using CQs and Kapacitor script, but there are two problems:
- We need to have informantion about the previous state of sensor(ON | OFF)
- How can we get the time stamp.
Third option we have is to write our own service, that will be fetching data from DB at every 10 seconds, but I am more worried that it may not have any impact on the server.
We are looking for some efficient methods.