breadlysm / SpeedFlux

Script to periodically run the Speedtest CLI application by Ookla and post results to InfluxDB.
MIT License
107 stars 68 forks source link

Making the script more robust #23

Open xNinjaKittyx opened 3 years ago

xNinjaKittyx commented 3 years ago

This is a minor irk of mine while using the docker container on unRAID - the docker dies when speedtests randomly fail and I have to restart again. I can work around this with docker's retry functionality, but would be nice to just work out of the box.

There's two things I think would make this better.

  1. Retry when writing to influxDB - Sometimes on a fluke, writing fails, crashing the whole docker. Would just be nice to retry 3 or 5 times and then just spit an error message if it fails (but keep running the tests at every interval). Maybe wait 30s or so between each one? (Unless there's seriously someone doing speedtests every 2 minutes).
  2. try/except inside the while loop - Mostly just to have the script continue when something fails randomly (and keep the sleep timer going)

Thanks for maintaining this project, There's several solutions out there, but the one I was using previously was using its own UI, and I wanted something to use grafana to visualize, so this is great!

cdrobey commented 1 year ago

I am also experiencing the script exits when influx takes too long start. Adding a longer polling interval or periodic sleep would significantly improve a fantastic tool.