Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
288 views
in Technique[技术] by (71.8m points)

performance - How can I calculate internet speed?

I want to calculate internet speed in embedded device. In my researches on the internet, I saw that in order to measure internet speed, I had to download data from a server and calculate according to the download time. But this creates a lot of data usage and tires the device. Are there any other methods I can use other than that?

If there is no other way, What is the optimal data size to download from server?

Thank you.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I think it's the only possible way to test data transfer, at least correctly. Simple ideas that can be used as speedtest:

  • Load image(s), check when it's fully loaded and calculate time difference divided by image size.
  • Make GET request which responds to you with desired chunk of data and on response calculate difference divided by response size.
  • Create POST request and send randomly generated data in it and on response calculate difference divided by image size.
  • Create websocket and send ping->pong messages. (Websocket used instead of HTTP request because of its lower latency and stability)

You should also take a look that in all of those tests data compression and caching should be disabled and that they may be affected by ping.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...