speedtest-cli icon indicating copy to clipboard operation
speedtest-cli copied to clipboard

Instead of just using Mbit/s or Mbyte/s to show the speed, we can use…

Open ealtintas opened this issue 6 years ago • 7 comments

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 avatar Feb 18 '19 03:02 ealtintas

@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

peaceiris avatar Feb 21 '19 07:02 peaceiris

@ealtintas

You should implement for --simple. The output of --simple is still Mbit/s.

peaceiris avatar Feb 21 '19 08:02 peaceiris

@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

peaceiris avatar Feb 21 '19 08:02 peaceiris

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?

ealtintas avatar Feb 25 '19 02:02 ealtintas

0.00 Mbyte/s

I think that it should not be displayed. Currently, it is not considered.

CC: @sivel

peaceiris avatar Feb 25 '19 02:02 peaceiris

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.

ealtintas avatar Feb 25 '19 02:02 ealtintas

Are there any problems with my pull request?

ealtintas avatar Mar 03 '19 02:03 ealtintas