Skip to content

adrianh-za/go-simple-speedtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-simple-speedtest

Program written in Go to perform simple file download to calculate download speed.

When the program is executed, it appends the download data to a file (speedtest.csv) in CSV format.

The CSV column data is:

  • time of file download
  • total bytes downloaded
  • total megabytes downloaded
  • total milliseconds to complete download
  • total seconds to complete download
  • speed of download in megabits/second (Mbps)
  • speed of download in megabytes/second (MBps)

Usage

  1. go get github.com/adrianh-za/go-simple-speedtest
  2. browse to $/go/src/github.com/adrianh-za/go-simple-speedtest
  3. go run main.go

Extra

The following cron job runs every 4 hours. The cron job has multiple steps:

  • 0 */4 * * * = Run every 4 hours.
  • PATH=$PATH:/usr/local/go/bin = Set the path to include GO executable location.
  • cd /home/pi/go/src/github.com/adrianh-za/go-simple-speedtest = Change the current directory to where the main.go file resides.
  • go run main.go = Run the program.
  • >> cron.txt 2>&1 = Dump output from cron job to this file (in the directory we changed to above) and don't mail output.

0 */4 * * * PATH=$PATH:/usr/local/go/bin && cd /home/pi/go/src/github.com/adrianh-za/go-simple-speedtest && go run main.go >> cron.txt 2>&1

About

Library written in Go to perform simple file download to determine download speed

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages