Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several problems on speedTest method in jquery.jsonrpcclient.js #33

Open
AleCaste opened this issue Jun 10, 2019 · 0 comments
Open

Several problems on speedTest method in jquery.jsonrpcclient.js #33

AleCaste opened this issue Jun 10, 2019 · 0 comments

Comments

@AleCaste
Copy link

Hello,

Today I was using the speedTest method in jquery.jsonrpcclient.js in order to measure upload&download speeds and I found several problems with it.

  1. The first one is that the specified amount of bytes is sent ONCE but downloaded TEN times.
    So if you specify 1000 bytes, the browser sends 1 chunk of 1000 bytes, but receives 10 chunks of 1000 bytes.
    In the following image you can see what I mean:

speedtest01_01

We should received the exact same data that we send. Or if you want to send the data 10 times from the server to the browser, the code in jquery.jsonrpcclient.js should take that into account in order to calculate the speeds.

  1. The downloaded speed that is sent from the server to the browser in the SPD message is wrong. The number provided should reflect the elapsed downloading time in milliseconds.
    But as you can see from the following network-tab capture (note the time column), the correct elapsed time should be something around this:

12:16:57.095 - 12:16:32.659 = 24.436s = 24436ms

... image showing the 1st download message ...

speedtest02_01

... image showing the last download message ...

speedtest02_02

... and as you can see the provided elapsed time is 385ms (see SPD message) not the correct 24436ms

  1. When you are working with speeds, 1 KB is equal to 1000 B (not 1024). So when calculating loops, rem, up_kps and down_kps you should use 1000 instead of 1024.
    Also I would rename up_kps to up_kbps and down_kps to down_kbps since otherwise you are missing one of the units (bits).

Regards,
Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant