Skip to content

McAvity/speedtest-cli-extras

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

speedtest-cli-extras

The speedtest-cli-extras repository contains tools that enhance the speedtest-cli command-line interface to speedtest.net for benchmarking an internet connection.

Requirements

  • The speedtest-csv tool requires Bash (just like speedtest-cli).
  • Windows users: The MinGW project's MSYS package is an straightforward way to get Bash on Windows. Note, there is a speedtest-csv.bat Windows Batch wrapper script that calls the bash script for you. In other words, if you can speedtest-csv at the Windows command prompt, it will work just as if you called it from Bash.

speedtest-csv

The speedtest-csv tool calls speedtest-cli, captures its multi-line output, reformats it, adds time stamps, and outputs the benchmark statistics on a single well formatted line, e.g.

$ speedtest-csv --standardize --sep '\t'
2016-04-04 09:24:31	2016-04-04 09:24:31	Comcast Cable	24.130.241.190	Monkey Brains (San Francisco, CA)	21.36 km	17.673 ms	5.32 Mbits/s		

Collecting statistics over time

By running the above on a regular basis (e.g. once an hour) and appending the output to a TAB-delimited file one can gather statistics over time. To add meaningful column names to the top of this file, start off by:

$ speedtest-csv --header --sep '\t' > speedtest_stats.tsv
# At 00:00 UTC
$ speedtest-csv --standardize --sep '\t' >> speedtest_stats.tsv
# At 01:00 UTC
$ speedtest-csv --standardize --sep '\t' >> speedtest_stats.tsv
# ...

$ less speedtest_stats.tsv
start	stop	from	from_ip	server	server_dist	server_ping	download	upload	share_url
2016-04-04 08:00:01	2016-04-04 08:01:01	Comcast Cable	24.130.241.190	Fastmetrics Inc. (San Francisco, CA)	20.46 km	18.168 ms	4.88 Mbit/s	1.34 Mbit/s	http://www.speedtest.net/result/5224137223.png
2016-04-04 09:00:02	2016-04-04 09:00:42	Comcast Cable	24.130.241.190	Monkey Brains (San Francisco, CA)	21.36 km	16.723 ms	3.40 Mbit/s	0.21 Mbit/s	http://www.speedtest.net/result/5224152283.png
[...]

If you're on Linux or OS X, you can use Cron jobs to automate the above.

Usage

$ speedtest-csv --help
Usage:
 speedtest-csv [options]

Options:
 --debug        Output extra debug information
 --header       Display field names (only)
 --help         This help
 --last         Use most recent stats, iff available
 --quote <str>  Use <str> as quotation mark
 --sep <str>    Use <str> as field separator
 --standardize  Standardize units and number formats
 --version      Display version

Example:
 speedtest-csv --standardize --sep '\t'

Copyright: 2014-2016 Henrik Bengtsson
License: GPL (>= 2.1) [http://www.gnu.org/licenses/gpl.html]

About

Tools to enhance the speedtest-cli network tools

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 93.3%
  • Batchfile 6.7%