Tests your internet speed, stores in a database, and plots trends on plotly.
Clone the repository:
$ git clone https://github.com/scul86/speed_test.gitOr download release zip
I prefer to use virtualenv for my python environment...
$ virtualenv -p python3 venv
$ venv/bin/pip install -r requirements.txtNote, you might have to install Cython as well:
$ venv/bin/pip install Cython$ sqlite3 speed.db
sqlite> CREATE TABLE data(
... id INTEGER PRIMARY KEY AUTOINCREMENT,
... ping INTEGER NOT NULL,
... down INTEGER NOT NULL,
... up INTEGER NOT NULL,
... dt DATETIME DEFAULT CURRENT_TIMESTAMP
... );
sqlite> .exitChange speed_test.config to contain your desired Paths and Plotly information.
$ ~/Documents/python/speed_test/speed_test.shThis should export a .png of the graph at [IMG_PATH]/internet_speeds.png, and send the same data to your Plotly account
I run this automatically every 30 minutes with crontab:
$ crontab -e
# m h dom mon dow command
0,30 * * * * ~/Documents/python/speed_test/speed_test.sh >> ~/Documents/python/speed_test/speed.log 2>&1This fetches the speed_test data every hour at 0 and 30 minutes, then reads, stores it in the db, and pushes to Plotly.
Please submit a bug report if you find something that could be improved!