{"id":38020068,"url":"https://github.com/ansemjo/speedtest-plotter","last_synced_at":"2026-01-16T19:28:17.328Z","repository":{"id":38820434,"uuid":"149361237","full_name":"ansemjo/speedtest-plotter","owner":"ansemjo","description":"running scheduled speedtests inside docker and plotting the results with gnuplot","archived":false,"fork":false,"pushed_at":"2025-12-19T12:03:31.000Z","size":963,"stargazers_count":61,"open_issues_count":8,"forks_count":12,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-12-22T04:39:33.151Z","etag":null,"topics":["bandwidth","docker","gnuplot","plot","speedtest","speedtest-cli"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ansemjo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-09-18T22:48:13.000Z","updated_at":"2025-12-19T12:03:29.000Z","dependencies_parsed_at":"2024-06-22T05:33:44.580Z","dependency_job_id":"261adda9-e714-4cce-b458-65f3e1246afe","html_url":"https://github.com/ansemjo/speedtest-plotter","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ansemjo/speedtest-plotter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansemjo%2Fspeedtest-plotter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansemjo%2Fspeedtest-plotter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansemjo%2Fspeedtest-plotter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansemjo%2Fspeedtest-plotter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ansemjo","download_url":"https://codeload.github.com/ansemjo/speedtest-plotter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansemjo%2Fspeedtest-plotter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bandwidth","docker","gnuplot","plot","speedtest","speedtest-cli"],"created_at":"2026-01-16T19:28:16.709Z","updated_at":"2026-01-16T19:28:17.302Z","avatar_url":"https://github.com/ansemjo.png","language":"Python","readme":"# speedtest-plotter\n\nThis is a collection of scripts, which takes internet speedtest measurements\nagainst the speedtest.net network with [taganaka/SpeedTest](https://github.com/taganaka/SpeedTest) and plots them\nwith [gnuplot](http://gnuplot.sourceforge.net). A crontab schedule is used\nto automate measurements every couple of minutes and save them to a database.\nThe results can be displayed through a simple Flask webserver.\n\n![example plot of speedtest results](assets/example.png)\n\n## USAGE\n\nFor changes between releases check the [changelog](CHANGELOG.md).\n\n### CONTAINER\n\n\u003ca href=\"https://github.com/ansemjo/speedtest-plotter/actions\"\u003e\n\n![GitHub Workflow Status](https://github.com/ansemjo/speedtest-plotter/actions/workflows/release.yml/badge.svg)\n\n\u003c/a\u003e\n\nThe main distribution method is the automatically built container\n[ghcr.io/ansemjo/speedtest](https://github.com/ansemjo/speedtest-plotter/pkgs/container/speedtest).\nObviously, you need to have a container runtime like `docker` or `podman`\ninstalled to run the container.\n\n**Note:** please update your image name to use the Github container registry.\nI will delete the DockerHub project sometime in the future.\n\nTo start the container with default settings run:\n\n    docker run -d -p 8000:8000 ghcr.io/ansemjo/speedtest\n\nThis will take a measurement every 15 minutes, save them to a SQLite database\nin `/data/speedtests.db` and run the webserver on port `8000`. Visit http://localhost:8000\nto look at the plotted results. (*Note: The smoothed bezier curves require at least two\nmeasurements and the image will stay blank otherwise. So you might have to wait a while first.*)\n\n#### TIMEZONE\n\nYour local timezone can be set with the `TZ` environment variable and a string from\n`tzselect`. If none is set usually UTC is assumed. For example users in Japan should use:\n\n    docker run -d -p 8000:8000 -e TZ=Asia/Tokyo ghcr.io/ansemjo/speedtest\n\n#### DATABASE\n\nFor data persistence, either mount a volume at `/data` to save the database file\nor set the environment variable `DATABASE` to an SQLAlchemy-compatible URI. A PostgreSQL\nURI might look like this:\n\n    docker run -d \\\n      -p 8000:8000 \\\n      -e TZ=Europe/Berlin \\\n      -e DATABASE=postgresql://user:password@hostname:5432/database' \\\n      ghcr.io/ansemjo/speedtest\n\n#### SCHEDULE\n\nYou can modify the measurement schedule with the environment variables `MINUTES` and\n`SCHEDULE`. The former takes a measurement every `n` minutes and the latter may define\nan entirely custom cron schedule like \"four times a day\":\n\n    docker run -d -p 8000:8000 -e SCHEDULE=\"0 3,9,15,21 * * *\" ghcr.io/ansemjo/speedtest\n\n#### MARKERS AND SCALING\n\nTo add horizontal dashed lines in the plot (e.g. to mark your expected bandwidths)\nyou can use environment variables `MARKER_DOWNLOAD` and `MARKER_UPLOAD`. The values\nare given in `MBit/s`. \n\nIn addition or independently from that you can also set a range scaling for the upload\nplot relative to the download range with `UPLOAD_SCALE`. For highly asymmetrical connections\nthis makes it easier to see the upload bandwidth. For example, the above example\npicture was created with:\n\n    docker run -d \\\n      [...] \\\n      -e MARKER_DOWNLOAD=800 \\\n      -e MARKER_UPLOAD=40 \\\n      -e UPLOAD_SCALE=10 \\\n      ghcr.io/ansemjo/speedtest\n\n#### DEFAULT FETCH LIMIT\n\nBy default, the webserver will fetch the last seven days (`7d`) for plotting. This can be configured\nwith the `limit=` query parameter per request and then bookmark this URL; i.e.\n`http://localhost:8000/?limit=30d` will fetch the last 30 days. Alternatively, you can set the\nenvironment variable `FETCH_LIMIT` to configure a different default value for all requests\nwithout the query parameter above.\n\n#### FONT AND RESOLUTION\n\nThe resolution and font of the SVG output can be configured with environment variables `RESOLUTION` and `FONT` respectively. Output resolution is expected as a comma-separated value of x- and y-size; the default is `1280,800`. The font can take either only a name (`Arial`), only a size (`,18`) or both (`Arial, 18`). Note that for a font in an SVG to work, the client needs to have the font, *not* the server. For example:\n\n    docker run -d \\\n      [...] \\\n      -e RESOLUTION=1920,1080 \\\n      -e FONT=\"Fira Sans, 14\" \\\n      ghcr.io/ansemjo/speedtest\n\n#### SPECIFIC TESTSERVER\n\nIf you want to test against a specific server, you can give a `host:port` combination\nin the environment variable `TESTSERVER`. You can use the API at\n[www.speedtest.net/api/js/servers](https://www.speedtest.net/api/js/servers?\u0026limit=10\u0026search=)\nto pick a suitable `host` key from the JSON; supply a parameter for `?search=...` if you need to.\nBy default it lists servers close to you. **Note** that this is *different* from the\n`SERVERID` used previously! But you can use `?id=...` to search for a specific ID.\n\nFor example, to test against wilhelm.tel in Norderstedt with the server ID 4087, you'd use:\n\n    docker run -d \\\n      [...] \\\n      -e TESTSERVER=speedtest.wtnet.de:8080 \\\n      ghcr.io/ansemjo/speedtest\n\n#### DISABLE WEBSERVER\n\nThe webserver is a single-threaded Flask application and pipes the data to gnuplot in a subprocess, which may not be suitable\nfor production usage. To disable the webserver completely set the `PORT` environment\nvariable to an empty string. This will only take measurements and save them to the\ndatabase.\n\n    docker run -d -e PORT=\"\" -v speedtests:/data ghcr.io/ansemjo/speedtest\n\n#### SHORTHAND COMMANDS\n\nTo dump the results as CSV from a running container use the `dump` command:\n\n    docker exec $containerid dump \u003e results.csv\n\nTo trigger a measurement manually use the `measure` command:\n\n    docker exec $containerid measure\n\nTo reimport a previous dump in a fresh container use `import`:\n\n    docker exec -i $containerid import \u003c results.csv\n\nThis can also be used to import results obtained manually with `speedtest-cli`.\n\n### PYTHON SCRIPT\n\nYou can use the Python script by itself locally, too. First install the requirements:\n\n    pip install -r requirements.txt\n\nChoose a database location and take any number of measurements:\n\n    ./speedtest-plotter -d sqlite:///$PWD/measurements.db measure\n    ...\n\nThen start the flask webserver to look at the results:\n\n    TZ=Europe/Berlin ./speedtest-plotter -d sqlite:///$PWD/measurements.db serve\n\n### GNUPLOT SCRIPT\n\nTo keep things really simple, you can also take measurements manually with `speedtest-cli` and only\nplot an image with `gnuplot`.\n\nThe [`plotscript`](plotscript) expects the format that `speedtest-cli` outputs when using the `--csv` flag\nand a header line from `--csv-header`. To take some measurements manually with a simple sleep-loop:\n\n    speedtest-cli --csv-header \u003e results.csv\n    while true; do speedtest-cli --csv | tee -a results.csv; sleep 600; done\n    ^C\n\nAfterwards plot the results to an SVG picture with:\n\n    gnuplot -c plotscript results.csv plot.svg\n\n## BREITBANDMESSUNG\n\nIf you're in Germany and you have found that your measured speed regularly does not meet minimum contractual obligations (\"erhebliche, kontinuierliche oder regelmäßig wiederkehrende Abweichung bei der Geschwindigkeit\") and your provider is not responsive to your complaints, you could use the [Breitbandmessung App](https://www.breitbandmessung.de/) as the next step. It helps you prepare a well-formatted measurement report, which you could use to file a complaint with the Bundesnetzagentur (BNetzA).\n\n## LICENSE\n\nCopyright (c) 2019 Anton Semjonov\nLicensed under the MIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansemjo%2Fspeedtest-plotter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fansemjo%2Fspeedtest-plotter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansemjo%2Fspeedtest-plotter/lists"}