Instead of just using Mbit/s or Mbyte/s to show the speed, we can use…
instead of just using Mbit/s or Mbyte/s to show the speed, we can use Kbit/s or Kbyte/s for slow connections and Gbit/s or Gbyte/s for fast connections.
- added "humanized" function which converts big number to kilo, mega, giga equivalent etc.
- added "--no-human" parameter which shows the speed using just bytes or bits
- when "--no-human" parameter isn't used, we shod the humanized version of speed. otherwise we show just plain bits or bytes (which will be more usable by machines)
@ealtintas
$ ./speedtest-cli
File "./speedtest-cli", line 1859
resultstr = humanized(results.download / args.units[1])
^
TabError: inconsistent use of tabs and spaces in indentation
$ ./speedtest-cli
File "./speedtest-cli", line 1871
resultstr = humanized(results.upload / args.units[1])
^
TabError: inconsistent use of tabs and spaces in indentation
@ealtintas
You should implement for --simple. The output of --simple is still Mbit/s.
@ealtintas
And, we can already use --byte option.
$ speedtest-cli --byte --simple
Ping: 42.391 ms
Download: 2.29 Mbyte/s
Upload: 0.88 Mbyte/s
Thanks for the review.
I am working on "--simple" implementation.
When using "--simple" if we also say "--no-download" or "--no-upload" we get "0.00 Mbyte/s" for the untested results.
Is this the correct way of operation? or shall we print no result for the untested function?
0.00 Mbyte/s
I think that it should not be displayed. Currently, it is not considered.
CC: @sivel
Changed "--simple" implemantation by removing two "quiet" parameters in the appropireate lines.
- Now it prints the result just after it is calculated.
- Now humanized printing also works for "--simple" mode
- Now "--simple" mode doesnt print "0.00 Mbytes" for the untested functions.
Can you re-check my commits.
Are there any problems with my pull request?