Skip to content

Exports speedtest-cli metrics in the prometheus format

License

Notifications You must be signed in to change notification settings

sjultra/speedtest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-speedtest-grafana

Docker setup consisting out of Grafana incl. a pre-configured dashboard, InfluxDB and a speedtest.net CLI test runner.

Installation

  1. Make sure you've installed all requirements
  2. Clone this repository:
git clone https://github.com/sjultra/speedtest.git
  1. Open docker-compose.yml and override env vars at will:

  2. Spin up the containers:

docker-compose up -d

Configuration

You can make use of the following environment variables / configurations:

Environment variable Default value Description
GRAFANA_PORT 3000 Port to bind Grafana webinterface on the host system
SPEEDTEST_INTERVAL 3600 Interval/pause (in seconds) between speedtests
SPEEDTEST_HOST local Display name of the client
SPEEDTEST_SERVER none Optionally set specific speedtest.net server ID, otherwise use the closest
INFLUXDB_DB speedtest Database to save speedtest results
INFLUXDB_HOST influxdb Name of the InfluxDB host/containers
INFLUXDB_USERNAME root Username for InfluxDB authentication
INFLUXDB_PASSWORD root Password for InfluxDB authentication

Usage

Services

Start/create services

$ docker-compose up -d
Creating speedtest_influxdb_1  ... done
Creating speedtest_grafana_1   ... done
Creating speedtest_speedtest_1 ... done

Stop services

$ docker-compose stop
Stopping speedtest_influxdb_1  ... done
Stopping speedtest_grafana_1   ... done
Stopping speedtest_speedtest_1 ... done

Upgrade services

$ docker-compose stop
$ docker-compose pull
$ docker-compose rm
$ docker-compose up -d

Check logs

$ docker-compose logs -f
$ docker-compose logs -f grafana

Grafana

Dashboard

By default the dashboard shows all speedtest results. To filter for a specifc host, simply add a and host = 'local' statement in the WHERE clause of the SQL select.

Example (Download Time Series):

SELECT mean("value") FROM "download" WHERE $timeFilter and host = 'local' GROUP BY time($interval) fill(null)

Administrative access

Access http://${HOSTNAME}:${GRAFANA_PORT} (http://localhost:3000 by default) and login using the following default credentials:

  • Username: admin
  • Password: admin

Contributing

  1. Fork it
  2. Create your feature branch:
git checkout -b feature/my-new-feature
  1. Commit your changes:
git commit -am 'Add some feature'
  1. Push to the branch:
git push origin feature/my-new-feature
  1. Submit a pull request

Requirements / Dependencies

  • Docker (incl. docker-compose)

Version

1.0.0

License

MIT

About

Exports speedtest-cli metrics in the prometheus format

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 66.8%
  • Smarty 17.9%
  • Dockerfile 15.3%