Measure connection speed and show it in a web application
we have a Java software to receive and send customer and contracts data from and to our servers. The software runs in a web browser. Sometimes our agents c开发者_如何学Pythonomplain about the lag, but it is related to their network connection. It's our thought to build in some kind of network monitor to show the current network speed. My first thought was it to implement a java version of the Ping program to measure the time before the ping and after the ping. With this information I would have been able to calculate the connection speed. The problem is that Java doesn't support SOCK_RAW type sockets so I can't send ICMP packets. Due to security reasons I can not create some kind of UDP client-server-connection to use UDP sockets. The servers with our customer and contract data is not modifiable due to security reasons so you can't use any sockets at all. In my opinion there doesn't seem to be a convenient way to solve this with Java. My colleage has another approach. He thought about downloading a picture to measure the download time but this is no good solution to permanently measure the connection speed.
So are there any usable possibilities to measure the connection speed with Java (JSF,JSP) or Javascript (jquery) and embed it on a web site?
To do a good measurement of the network connection, you should probably try and send as much information as possible to see how long it took. A picture would be great, but another approach might be to measure the RTT (Round trip time) to your servers to detect possible latency-related problems.
If you don't want to program it yourself and do not have the need to bundle it with your software you might use http://www.speedtest.net for example :-)
精彩评论