This script is written to work with Python 3.6 & 3.7. For Windows & macOS, you can download Python from the official website. Installing Python on Linux is more complicated, please see the Hitchhiker's Guide to Python for more information.
It makes use of the requests library which will need to be installed through pip.
This can be done by running python -m pip install requests
in command line/terminal.
You may need to use python3
(or similar) instead of python
in some installations.
With the Python environment setup, the configuration file needs to be edited to test your desired site or sites. Within the config.ini file you will find two "variables" that can be set. Example values for both of these are provided within the config.ini file, as well as comments explaining each variable's purpose.
The first, [Tester] sites
, is a comma separated list of all the sites that the script should test the loading speed for.
Eg.
sites = https://google.co.uk, https://bbc.co.uk
The second value, [Database] file
, is the file name (and location/path) of the database file that the results will be saved to.
Eg.
file = results.db
With the Python environment prepared and the configuration file edited, the script should be ready to run.
To do this, simply run python run.py
in your command line/terminal.
As with the pip command, python
may need to be substituted with python3
or similar to access your python installation.
Once you have run the script, the results will be saved to the database file that your defined in the configuration file. This file is a flat-file SQLite database. You can view the data contained through a tool such as the DB Browser for SQLite.
Within the database there is a single schema, named results
.
This houses all result logs from the testing script.
Each entry contains the following values:
test_id
- INT - Autoincrement-ing ID for each log entry (primary key)datetime_utc
- DATETIME - The timestamp when the result was logged, in UTCtarget_url
- TEXT - The target URL of this testtime_seconds
- REAL - The time the test request took to complete, in secondsstatus_code
- INT - The response status code from the website testedrequest_error
- TEXT - The error raised by the request if applicableinternal_ip
- TEXT - The internal IP address of the device that ran the testexternal_ip
- TEXT - The external IP address of the device/network that ran the test
Note: If an error occurs during the request,
status_code
will be set to-1
,time_seconds
set to0
and the error caught will be logged inrequest_error
.
Contributions are always welcome to this project!
Take a look at any existing issues on this repository for starting places to help contribute towards, or simply create your own new contribution to the project.
Please make sure to follow the existing standards within the project such as code styles, naming conventions and commenting/documentation.
When you are ready, simply create a pull request for your contribution and I will review it whenever I can!
You can also help me and the project out by contributing through a donation on PayPal or by supporting me monthly on my Patreon page.
Need support with this project, have found an issue or want to chat with others about contributing to the project?
Please check the project's issues page first for support & bugs!
Not found what you need here?
- If you have an issue, please create a GitHub issue here to report the situation, include as much detail as you can!
- or, You can join our Slack workspace to discuss any issue, to get support for the project or to chat with contributors and myself: