Git Product home page Git Product logo

rsvp / speedtest-linux Goto Github PK

View Code? Open in Web Editor NEW
129.0 9.0 14.0 15 KB

Get download/upload speeds via speedtest.net or fast.com from command line using Bash script -- suitable for logs. POSIX OSX Linux

Home Page: https://fast.com

License: BSD 3-Clause "New" or "Revised" License

Shell 100.00%
speedtest bash internet-speed internet-speed-checker linux cli fast-com speedtest-net posix osx

speedtest-linux's Introduction

speedtest-linux

From the command line get ping/download/upload stats:

  • from https://speedtest.net or https://fast.com
  • without their ads
  • without their web GUI or app interface
  • simply timestamped in one-line CSV format
  • suitable for logs
  • using Bash shell script
  • for all POSIX systems
______________|  speedtest : ping, download and upload speeds.
                             Commandline using speedtest.net resources.
                             This standalone script is a wrapper. 
                                        
         Usage:  speedtest [--log|--simple|--verbose|--list|--fav|--version]

                 Takes about a minute for results to appear.
                 For logfile, the variable $logf can be modified.

      Examples:  $ speedtest --simple 
                 Ping: 22.602 ms
                 Download: 0.62 Mbit/s
                 Upload: 0.25 Mbit/s
                 
                 $ speedtest   #  No args for single line timestamped.
                 2015-03-13, 19:25, 22.602, 0.62, 0.25

                 $ speedtest --log  #  Will cat logfile with latest result.

  Dependencies:  curl (Used to download the following Python script:)
                 speedtest.py (https://github.com/sivel/speedtest-cli)

fasttest

Get just the download speed via fast.com from the command line, suitable for logs. The infrastructure is provided by Netflix to make sure ISPs are not throttling their streaming movies.

______________|  fasttest : download speed in Mbps, flag to log results. 
                            Uses Netflix's fast.com resources,
                            checking via both IPv4 and IPv6.
                            This standalone script is a wrapper. 

         Usage:  fasttest [--log|--verbose]

                 Takes about a minute for results to appear.
                 For logfile, directory variable $logdir should be modified.

      Examples:  $ fasttest   #  No args for single line timestamped.
                 2017-03-06, 19:25, None, 0.62, None

                 $ fasttest --log  #  Will cat logfile with latest result.

                 $ fasttest --log tmp.log  #  else default: fasttest.log

  Dependencies:  curl (Used to download the following Python script:)
                 fast_com.py (https://github.com/sanderjo/fast.com)

Comparison

For execution time, speedtest runs about 60% faster than fasttest. In terms of information, speedtest provides more than fasttest, and is more accurate in measuring download speed. The code base for speedtest is more mature and receives more support and scrutiny, compared to that of fasttest.

Magic one-liner

Given our preferred choice: speedtest -- here is a way to directly access its service without cloning our repository:

$ echo "$(curl -skLO https://git.io/speedtest.sh && chmod +x speedtest.sh && ./speedtest.sh)"
2015-03-13, 19:25, 22.602, 0.62, 0.25

The curl command retrieves the most current version of speedtest, renamed for this exercise as speedtest.sh, then we execute it to display: date, local time, ping in milliseconds, followed by download and upload speeds in Mbps (Megabits per second).

To fine-tune the logging functions, please fork our repository.

Acknowledgements

Many thanks to the developers upstream: @sivel and @sanderjo -- we rely on their latest updates to the Python source code.

Shortcut to this project: https://git.io/speed


README.md update : 2017-03-09

speedtest-linux's People

Contributors

rsvp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

speedtest-linux's Issues

Permission denied

Hi,

Im getting a permission denied error. You know how to handle it?

./speedtest --log
./speedtest: line 116: /dev/shm/88_speedtest_tmp.3pYeaVRNKb: Permission denied

Thanks!

Failed

Timed out
root@alienware:~/sys.info# echo "$(curl -skLO https://git.io/speedtest.sh && chmod +x speedtest.sh && ./speedtest.sh)"
Cannot retrieve speedtest server list
ERROR: timed out
2018-03-15, 17:01,

USER: unbound variable when used in a cron job

I get this error when used in a cron job:
speedtest: line 92: USER: unbound variable

USER env variable isn't available when used as a cron job. I suggest using HOME variable in line 92 instead.

speedtest: urlopen error timed out

dreamt:/tmp # ./speedtest --verbose
Retrieving speedtest.net configuration...
Cannot retrieve speedtest configuration
ERROR: <urlopen error timed out>

 !!  speedtest: unhandled ERR via trap, but cleanup finished. 
dreamt:/tmp # 

Running Average of results.

Hey I didn't know where else to post this. I wanted to mention that I used your script and created a companion script that calculates a running average of the speed tests.

Here's the repo:
https://github.com/kgor93/SpeedTest-Average

And here's what the output looks like. Thanks!

`root@ny:~# ./script.sh
Running speedtest now. Please wait...
Current - 1 run number
Ping: 12.646
Download: 924.59 MBps
Upload: 6.91 MBps

Average after - 1 runs
Ping: 12.65 ms
Download: 924.59 Mbps
Upload: 6.91 Mbps

Running speedtest now. Please wait...
Current - 2 run number
Ping: 12.615
Download: 917.18 MBps
Upload: 5.62 MBps

Average after - 2 runs
Ping: 12.63 ms
Download: 920.89 Mbps
Upload: 6.27 Mbps

Running speedtest now. Please wait...
Current - 3 run number
Ping: 18.183
Download: 924.03 MBps
Upload: 8.68 MBps

Average after - 3 runs
Ping: 14.48 ms
Download: 921.93 Mbps
Upload: 7.07 Mbps

Running speedtest now. Please wait...
Current - 4 run number
Ping: 12.51
Download: 417.67 MBps
Upload: 20.24 MBps

Average after - 4 runs
Ping: 13.99 ms
Download: 795.87 Mbps
Upload: 10.36 Mbps

Running speedtest now. Please wait...
Current - 5 run number
Ping: 12.527
Download: 779.07 MBps
Upload: 5.89 MBps

Average after - 5 runs
Ping: 13.70 ms
Download: 792.51 Mbps
Upload: 9.47 Mbps
----------------------`

Mkstemp failed on Mac OS X

Whenever I run the script on Mac OS X, I get the following error (the part after the tmp is different each time)

mktemp: mkstemp failed on /dev/shm/88_speedtest.sh_tmp.jVA7zHF6Uj: No such file or directory

Also if I run

echo "$(curl -skLO https://git.io/speedtest.sh && chmod +x speedtest.sh && ./speedtest.sh)"

I get a blank output and it doesn't actually download the script. I have curl and jq installed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.