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

Average network speed include server latency #45

Open
bangarharshit opened this issue Feb 9, 2018 · 6 comments
Open

Average network speed include server latency #45

bangarharshit opened this issue Feb 9, 2018 · 6 comments

Comments

@bangarharshit
Copy link
Contributor

For slow network calls, the average speed includes endpoint latency. Now we have info about connection start in okhttp 3.9 - EventLisetener, do you guys think it will be useful?

@anirudhramanan
Copy link
Collaborator

anirudhramanan commented Feb 14, 2018

Yes. The average speed takes into account the response time(includes server latency), and the response size.

Personally, i think the new api's provided by okhttp would be more accurate in terms of time taken and average speed. Also you can now track time on a granular level (dns lookup time, connection establishment time, and response time). The api's are not final yet, but this seems promising

@bangarharshit
Copy link
Contributor Author

bangarharshit commented Oct 6, 2018

It is final now as of 3.11. Will be happy to send a PR if you are ok and we can agree on the approach.

@anirudhramanan
Copy link
Collaborator

anirudhramanan commented Oct 6, 2018

Sure, that would be great :)

@yesidlazaro
Copy link

hi, @bangarharshit did you make the adjustment ? i looking for a similar solution

@bangarharshit
Copy link
Contributor Author

No, I never did that because basic OkHttp events sufficed for me. this library needs your app to have large number of network calls so as to use moving window to find the network speed. This was not true for my app.

I can make this fix but will be interested to know what is your use case?

@anjalsaneen
Copy link

anjalsaneen commented Oct 6, 2021

it's not a good idea to get download speed from the response body using EventLisetener until and unless you have a very big response body. we measured network speed from this and the value we are getting here is inaccurate. Let me know if anyone can measure downstream speed successfully.

Screenshot 2021-10-06 at 2 16 37 PM

Our Average Network Body Length = 1.6k Byte Our Average Network Body Download Duration = 15 ms

The Speed we are getting with this is very slow (0.00000594Mbps)

2021-10-06 14:19:40.221 3475-27752 D: <<<<DownstreamSpeed time=118.371MilliSec, Response Body Size=0.09KB, Speed=7.425013305623844E-7MBps BitSpeed=5.940010644499075E-6Mbps
2021-10-06 14:19:40.245 3475-27561 D: <<<<DownstreamSpeed time=122.698MilliSec, Response Body Size=0.09KB, Speed=7.163166881285759E-7MBps BitSpeed=5.730533505028607E-6Mbps
2021-10-06 14:19:40.253 3475-27791 D: <<<<DownstreamSpeed time=123.302MilliSec, Response Body Size=0.09KB, Speed=7.12807780895687E-7MBps BitSpeed=5.702462247165496E-6Mbps
2021-10-06 14:19:40.268 3475-27765 D: <<<<DownstreamSpeed time=124.889MilliSec, Response Body Size=0.09KB, Speed=7.037499299377848E-7MBps BitSpeed=5.629999439502278E-6Mbps
2021-10-06 14:19:40.303 3475-27614 D: <<<<DownstreamSpeed time=130.796MilliSec, Response Body Size=0.1KB, Speed=7.466302486314567E-7MBps BitSpeed=5.973041989051654E-6Mbps
2021-10-06 14:19:40.317 3475-27576 D: <<<<DownstreamSpeed time=131.234MilliSec, Response Body Size=0.1KB, Speed=7.441383330539342E-7MBps BitSpeed=5.953106664431474E-6Mbps
2021-10-06 14:19:40.529 3475-27792 D: <<<<DownstreamSpeed time=133.184MilliSec, Response Body Size=0.1KB, Speed=7.332431072801538E-7MBps BitSpeed=5.865944858241231E-6Mbps
2021-10-06 14:19:40.555 3475-27877 D: <<<<DownstreamSpeed time=133.211MilliSec, Response Body Size=0.1KB, Speed=7.330944891938353E-7MBps BitSpeed=5.864755913550682E-6Mbps
2021-10-06 14:19:40.580 3475-27614 D: <<<<DownstreamSpeed time=134.757MilliSec, Response Body Size=0.1KB, Speed=7.246840609393204E-7MBps BitSpeed=5.797472487514563E-6Mbps
2021-10-06 14:19:40.604 3475-27713 D: <<<<DownstreamSpeed time=134.848MilliSec, Response Body Size=0.1KB, Speed=7.241950195775985E-7MBps BitSpeed=5.793560156620788E-6Mbps
2021-10-06 14:19:40.615 3475-27878 D: <<<<DownstreamSpeed time=134.94MilliSec, Response Body Size=0.1KB, Speed=7.237012746405811E-7MBps BitSpeed=5.7896101971246486E-6Mbps
2021-10-06 14:19:40.622 3475-27576 D: <<<<DownstreamSpeed time=137.511MilliSec, Response Body Size=0.11KB, Speed=7.811875049996E-7MBps BitSpeed=6.2495000399968E-6Mbps
2021-10-06 14:19:40.649 3475-27765 D: <<<<DownstreamSpeed time=139.016MilliSec, Response Body Size=0.11KB, Speed=7.727302972319733E-7MBps BitSpeed=6.181842377855787E-6Mbps
2021-10-06 14:19:40.681 3475-27719 D: <<<<DownstreamSpeed time=139.019MilliSec, Response Body Size=0.12KB, Speed=8.429603147771168E-7MBps BitSpeed=6.743682518216934E-6Mbps
2021-10-06 14:19:40.819 3475-27765 D: <<<<DownstreamSpeed time=172.376MilliSec, Response Body Size=0.13KB, Speed=7.36489563512322E-7MBps BitSpeed=5.891916508098576E-6Mbps
2021-10-06 14:19:41.112 3475-27765 D: <<<<DownstreamSpeed time=173.963MilliSec, Response Body Size=0.13KB, Speed=7.297708420756139E-7MBps BitSpeed=5.838166736604911E-6Mbps
2021-10-06 14:19:41.144 3475-27719 D: <<<<DownstreamSpeed time=173.966MilliSec, Response Body Size=0.13KB, Speed=7.297582573606337E-7MBps BitSpeed=5.838066058885069E-6Mbps
2021-10-06 14:19:43.181 3475-27760 D: <<<<DownstreamSpeed time=180.218MilliSec, Response Body Size=0.13KB, Speed=7.044419813781089E-7MBps BitSpeed=5.635535851024871E-6Mbps
2021-10-06 14:19:43.282 3475-27832 D: <<<<DownstreamSpeed time=180.503MilliSec, Response Body Size=0.13KB, Speed=7.033297230516945E-7MBps BitSpeed=5.626637784413556E-6Mbps
2021-10-06 14:19:43.551 3475-27760 D: <<<<DownstreamSpeed time=180.53MilliSec, Response Body Size=0.13KB, Speed=7.03224533318562E-7MBps BitSpeed=5.625796266548496E-6Mbps
2021-10-06 14:19:43.605 3475-27837 D: <<<<DownstreamSpeed time=180.559MilliSec, Response Body Size=0.13KB, Speed=7.031115867943443E-7MBps BitSpeed=5.6248926943547544E-6Mbps

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

4 participants