thiezn / iperf3-python

Python wrapper around iperf3
https://iperf3-python.readthedocs.org/
MIT License
110 stars 51 forks source link

Fix calculation in Mpbs vs MB_s #19

Closed rustyhowell closed 7 years ago

rustyhowell commented 7 years ago

I was getting conflicting Mbits/sec results from iperf3-python vs iperf3 on the command line. After investigation, I found the math error.

Commit msg: When measuring in bits (kbps and Mbps), use k == 1000, M == 1000000 When measuring in bytes (kB_s and MB_s), use k == 1024, M == 1024**2

Also added a unittest for this calculation

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.4%) to 97.288% when pulling c0d28444a42c8850371978d9672322c0500efc29 on rustyhowell:master into cba75c1d71ae0ea598df8179e8f2783c4aff6dc2 on thiezn:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 98.644% when pulling c0d28444a42c8850371978d9672322c0500efc29 on rustyhowell:master into cba75c1d71ae0ea598df8179e8f2783c4aff6dc2 on thiezn:master.

thiezn commented 7 years ago

Thanks @rustyhowell you are right, I got my bits mixed up here. The world should all just agree 1k is 1024 but I guess we'll have to settle. I'll merge your changes and push out a new version to PyPi later today