purpose: track and visualize DSL speed over a longer period (runnable on a Raspberry Pi)
'speedTracker' has two modes:
- a mode 1 for producing data periodically via a cron job, it will generate the output at a fixed location:
speedtracker run
it does:
-
read config file with following basic information:
- data_dir : directory where data is stored
- output_file : should be on a path served by a webserver (apache e.g.)
- output_xdays : number of days in the past (from today) the data should be visualized
- log_file : logfile name and location
-
start "speedtestJson" and append its output at the file of the current month in 'data_dir'.
-
read and filter files(s) to get the data of the last 'output_xdays'.
-
transform the data into a self-containing html page at location 'output_file'.
- a mode 2 to produce a self a self-containing html page at a given location (without calling speedtestJson):
speedtracker 2022-01-01 2021-12-31 ./index.html
note: the purpose of this mode is to visualize historic data from e.g. two month ago.
it does:
-
parse following parameter from command line by position (as in the example above):
- output_file
- from_date
- to_date
-
read config file to get 'data_dir'.
-
read and filter files(s) to get the data of the dates 'from_date' - 'to_date'
-
transform the data into a self-containing html page at location 'output_file' (given as command parameter).
- package wireless-tools (.deb) for command "iwgetid" (if the WLAN SSID should be in the output)
- requirements from SpeedTest (see README.md of linked SpeedTest)
- any webserver to serve static data
- Ensure that you cloned this repository including submodules
git clone --recurse-submodules https://github.com/fmantz/SpeedTracker.git
- install rust and compile speedtracker
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cd speedtracker
cargo build --release
-
compile and install SpeedTest (see ./SpeedTest/README.md of linked SpeedTest repository)
-
copy "target/release/speedtracker" and "SpeedTest/speedtestJson" into one new directory e.g. "/opt/speedtracker"
-
copy "pi_files" into "/opt/speedtracker"
-
create a cronjob for speedtracker via 'crontab -e' e.g.:
#run every two hours
0 */2 * * * /opt/speedtracker run
- install a webserver e.g. apache
sudo apt-get install apache
- modify /speedtracker.toml, interesting settings are:
data_dir = './' <- your data files are stored here, best practice not on the sdcard but on a usb thumb drive
output_file = '/var/www/html/index.html', <- your output file must be served by the webserver, so pick a directory that is served
output_xdays = 14 <- numbers of days in the past you are intersted in (can be changed anytime, no data is deleted)
log_file = './speedtracker.log' <- location where your log file is stored
[download_chart.expected_value]
value = 250.0 <- your expected download speed, it is in Mbits/s (only used to display a baseline)
[upload_chart.expected_value]
value = 25.0 <- your expected upload speed, it is in Mbits/s (only used to display a baseline)
-
ensure that all file locations you specified above are writable
-
enjoy and wait for your collected data
If you do not want to run SpeedTracker on a Raspberry Pi but on a NAS, you can use docker. Settings you might want to change are in directory ./docker_files. (see Install on a Raspberry Pi).
Either build it yourself via:
docker build . --tag speedtracker:0.1.0
docker run -dit --name mySpeedTracker -p 8080:80 speedtracker:0.1.0
or pull the ready to run container from dockerhub:
docker pull fmantz/speedtracker
docker run -dit --name mySpeedTracker -p 8080:80 fmantz/speedtracker
SpeedTracker is available as open source program under the terms of the MIT License.