You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
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.
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 ...
... image showing the last download message ...
... and as you can see the provided elapsed time is 385ms (see SPD message) not the correct 24436ms
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
The text was updated successfully, but these errors were encountered:
Hello,
Today I was using the
speedTest
method injquery.jsonrpcclient.js
in order to measure upload&download speeds and I found several problems with it.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:
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.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 ...
... image showing the last download message ...
... and as you can see the provided elapsed time is
385ms
(see SPD message) not the correct24436ms
loops
,rem
,up_kps
anddown_kps
you should use 1000 instead of 1024.Also I would rename
up_kps
toup_kbps
anddown_kps
todown_kbps
since otherwise you are missing one of the units (bits).Regards,
Alex
The text was updated successfully, but these errors were encountered: