Fromthecommandlinegetping/download/uploadstats:
fromhttps://speedtest.netorhttps://fast.comwithouttheiradswithouttheirwebGUIorappinterfacesimplytimestampedinone-lineCSVformatsuitableforlogsusingBashshellscriptforallPOSIXsystems______________|speedtest:ping,downloadanduploadspeeds.Commandlineusingspeedtest.netresources.Thisstandalonescriptisawrapper.Usage:speedtest[--log|--simple|--verbose|--list|--fav|--version]Takesaboutaminuteforresultstoappear.Forlogfile,thevariable$logfcanbemodified.Examples:$speedtest--simplePing:22.602msDownload:0.62Mbit/sUpload:0.25Mbit/s$speedtest#Noargsforsinglelinetimestamped.2015-03-13,19:25,22.602,0.62,0.25$speedtest--log#Willcatlogfilewithlatestresult.Dependencies:curl(UsedtodownloadthefollowingPythonscript:)speedtest.py(https://github.com/sivel/speedtest-cli)fasttestGetjustthedownloadspeedviafast.comfromthecommandline,suitableforlogs.TheinfrastructureisprovidedbyNetflixtomakesureISPsarenotthrottlingtheirstreamingmovies.
______________|fasttest:downloadspeedinMbps,flagtologresults.UsesNetflix'sfast.comresources,checkingviabothIPv4andIPv6.Thisstandalonescriptisawrapper.Usage:fasttest[--log|--verbose]Takesaboutaminuteforresultstoappear.Forlogfile,directoryvariable$logdirshouldbemodified.Examples:$fasttest#Noargsforsinglelinetimestamped.2017-03-06,19:25,None,0.62,None$fasttest--log#Willcatlogfilewithlatestresult.$fasttest--logtmp.log#elsedefault:fasttest.logDependencies:curl(UsedtodownloadthefollowingPythonscript:)fast_com.py(https://github.com/sanderjo/fast.com)ComparisonForexecutiontime,speedtestrunsabout60%fasterthanfasttest.Intermsofinformation,speedtestprovidesmorethanfasttest,andismoreaccurateinmeasuringdownloadspeed.Thecodebaseforspeedtestismorematureandreceivesmoresupportandscrutiny,comparedtothatoffasttest.
Magicone-linerGivenourpreferredchoice:speedtest--hereisawaytodirectlyaccessitsservicewithoutcloningourrepository:
$echo"$(curl-skLOhttps://git.io/speedtest.sh&&chmod+xspeedtest.sh&&./speedtest.sh)"2015-03-13,19:25,22.602,0.62,0.25Thecurlcommandretrievesthemostcurrentversionofspeedtest,renamedforthisexerciseasspeedtest.sh,thenweexecuteittodisplay:date,localtime,pinginmilliseconds,followedbydownloadanduploadspeedsinMbps(Megabitspersecond).
Tofine-tunetheloggingfunctions,pleaseforkourrepository.
AcknowledgementsManythankstothedevelopersupstream:@siveland@sanderjo--werelyontheirlatestupdatestothePythonsourcecode.
Shortcuttothisproject:https://git.io/speed
README.mdupdate:2017-03-09
评论