frdmn/docker-speedtest-grafana

(Feature request) Test against multiple servers

Opened this issue · 4 comments

Please consider adding a feature where we can define multiple speed test server and it tests against those sequentially. One can define the speed test server using the ID.

I would love to have a test report from a couple of servers in India, Europe, US and Singapore.

Why not just run multiple containers each with a different SPEEDTEST_HOST and SPEEDTEST_SERVER but all pointing to the same InfluxDB?

The problem in doing that would be - all speed test instance would run at the same time, will choke the pipe and will lead to inconsistent results. If running one after other then we know for sure that only one test is running a given time.

frdmn commented

You could add some delays in addition:

version: '2'

services:
  speedtest1:
    restart: always
    image: frdmn/speedtest-grafana:latest
    command: sh -c "
      sleep 300 &&
      node index.js"

  speedtest2:
    restart: always
    image: frdmn/speedtest-grafana:latest
    command: sh -c "
      sleep 600 &&
      node index.js"

The above delays likely wouldn’t work well since, they could overlap in the future. Likely the better way would be to have a PR for looping through a list of comma-separated SERVER_HOST values but this seems a very specific use case? Changing the delay to be more of a cron-type schedule would also likely help for multiple containers at least