Thank you. I will try the Losant API.
I do have a follow-up question: is querying the Losant API the best way to approach this, or should we use a different mechanism entirely?
We have a device uploading measurements. Our system requires the notion of ‘start test’ and ‘stop test’. Right now, the start/stop test values appear as a field in our device state, so my plan was to search through the complete device history to detect instances of test-start/test-stop.
However, I foresee that this might cause performance issues when our device history gets big enough (large database queries).
A couple of alternatives I thought of:
- Use a workflow to detect test-start/test-stop on incoming device-state, rather than querying history. But where do we store the result? A data-table? Something else?
- Use a webhook to inform our system of test-start/test-stop. Same question: where do we store the result?
Ultimately, we want a page where we can view a list of tests run by a particular device, where a ‘test’ is defined as the set of measurements taken in between a test-start and test-stop.
So we can identify the set of tests at the time of page-view, which requires a large database query, or we can count incoming tests as they occur, but then I’m not sure where to store the tests which are identified.
In terms of timing, each test may last anywhere from a few hours to a few weeks.