Skip to content

scul86/speed_test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

speed_test


Tests your internet speed, stores in a database, and plots trends on plotly.

Install


Clone the repository:

$ git clone https://github.com/scul86/speed_test.git

Or download release zip

Configure your python environment

I prefer to use virtualenv for my python environment...

$ virtualenv -p python3 venv
$ venv/bin/pip install -r requirements.txt

Note, you might have to install Cython as well:

$ venv/bin/pip install Cython

Set up the database:

$ 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> .exit

Personalize speed_test.config

Change speed_test.config to contain your desired Paths and Plotly information.

Run


$ ~/Documents/python/speed_test/speed_test.sh

This should export a .png of the graph at [IMG_PATH]/internet_speeds.png, and send the same data to your Plotly account

Automation


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>&1

This fetches the speed_test data every hour at 0 and 30 minutes, then reads, stores it in the db, and pushes to Plotly.

Improvements


Please submit a bug report if you find something that could be improved!

About

Tests and plots internet speed

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors