开发者

Testing Internet connectivity problems such as hangs and timeouts with Javascript

开发者 https://www.devze.com 2022-12-17 02:09 出处:网络
I have a web app that I provide to small to medium-sized businesses as a service. Most of the support calls I get concerning speed issues end up being caused by problems on my clients\' networks.

I have a web app that I provide to small to medium-sized businesses as a service. Most of the support calls I get concerning speed issues end up being caused by problems on my clients' networks.

I would like to be able to point them to a specific web page that will run an x-minute test where multiple HTTP requests would be made via JavaScript every y seconds, which would then report back any problems such as longer-than-usual responses (>5 seconds) and timeouts. In theory this would mimic normal web app usag开发者_如何学运维e without taking into account things like database hits and would help reproduce intermittent hangs.

My question is two-fold:

  1. Is this an effective way to test simple HTTP connectivity (beyond ping/tracert) to determine if the slowness a client is experiencing is HTTP related?

  2. Does anyone know of any examples of this type of thing?

I'm not necessarily looking for code; I'm curious whether this is a viable solution to helping me more quickly diagnose my clients' connectivity issues.

Thanks.


You can make periodic calls with xmlhttprequest and you can accurately obtain some network diagnostics. For instance, you can determine how fast files are transferring by seeing how long it takes to download them. You can also make periodic tests and count the failure to determine packet loss. However a tool like fping is much much better at identifying packet loss. The "Same Origin Policy" for javascipr puts a serious limitation on what you can do. Having a client side application written in C++ or even Java (maybe an applet?) would be more accurate and could provide a wider verity of tests (like the tests that fping is capable of).


There are lots of sites that measure connection speeds by making you download some big image and measuring the time it takes until the browser gets it, and as far as I know that measurement is made using JavaScript.

So, if you google for internet speed test you'll probably get lots of inspiring examples for what you need.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号