loganmarchione / docker-speedtest-influxdbv2

Runs Ookla's Speedtest CLI program in Docker, sends the results to InfluxDB
https://hub.docker.com/r/loganmarchione/docker-speedtest-influxdbv2
9 stars 9 forks source link

Feature Request - Add summary result to docker logs #2

Closed n1nj4888 closed 3 years ago

n1nj4888 commented 3 years ago

Hi @loganmarchione,

Currently the docker image outputs the following to the docker container logs on each speedtest execution:

STATE: Your URL is https://www.speedtest.net/result/XXXXXXXX  --- This is not saved to InfluxDB
STATE: Writing to database
STATE: Sleeping for 600 seconds

Could you please consider adding an extra output line here which outputs a simple result summary, such as the below? Note that the speedtest json output (and therefore the InfluxDB record) contains the download/upload bandwidth in bytes/sec rather than Mbps (which is the unit of measure shown at the result URL given and I'd argue better to display the same on the docker container log output below?) - It may also be worth considering adding a note to the readme that the results are logged to the InfluxDB in bytes/sec and so the user may have to do bytes/sec * 8 / 1000 / 1000 to get Mbps?

STATE: Speedtest result: Download = xx.xx Mbps, Upload = yy.yy Mbps, Ping = zz.zz ms, Server = <Server ID>, <Server Name>, <Server Location>, <Server Country>
STATE: Your URL is https://www.speedtest.net/result/XXXXXXXX  --- This is not saved to InfluxDB
STATE: Writing to database
STATE: Sleeping for 600 seconds

In addition, the Result URL is not currently written to the database, but this maybe useful if the user wants to go back and see more detailed information from speedtest's website?

Thanks for your consideration!

loganmarchione commented 3 years ago

Funny, I removed the extra logging in an earlier commit, so I added it back in.

As for bps vs Mbps, I emailed Ookla about that months ago, but haven't heard back. I'm going to keep logging the results in bps (the default) and let the user convert afterwards in the visualizing tool (e.g., Grafana, Kibana, etc...).

I pushed 0.0.12 with the two above changes.

I'll look into the URL, it may be difficult because of the special characters : and /.

loganmarchione commented 3 years ago

On second thought, I'm not going to include the website in the info sent to the DB.

  1. This isn't really time-series data that can be graphed (although, neither is the city, state, and server host)
  2. There is no extra data on the website that isn't already being pushed to the DB.