I have a client that would like to see what % of the previous X polls were successful. I've tried many things, but can't get what he really wants. Hopefully I'm missing something obvious.
We can look at the Runtime Status, or hit the /data-sources/status endpoint to get a snapshot of the last 10 successful and aborted polls. Any chance these are stored as a data point somewhere with the history?
Here's what we've looked into so far:
I know there's the internal data points which include the Poll Success Percent, but that goes back to the time the data source was re-started. That won't give us a good picture of the polls over the past 1 or 2 minutes.
I've also looked into the "previous sequential successful polls" but that seems to have a bug. See this post I had on it for more details: https://forum.mango-os.com/topic/4948/question-on-internal-metric-previous-sequential-successful-polls/
Right now we're using the Slave Monitor 1/0 value to know the % of time over the past x seconds Mango has been able to communicate with the Modbus device, but that's not really what the client wants. That doesn't tell him if individual polls aborted.
The only other solution I can think of is to hit the /data-sources/status API every x seconds, parse through the results and save them as data points.
If we did that, is there a way to hit the Mango API from a Scripting Data Source? That would make it easier to schedule the job and save results into a data point. It doesn't look like jQuery or an XMLHttpRequest can be used in the scripting data source. If possible, I'd like to avoid custom jobs and code being written outside of Mango.