开发者

Number of hits while loading a webpage?

While loading a web page I want to calculate number of hits to the server(Number of requests and and number of responses). For example while loading http://www.stackoverflow.com how many times it requests the server and the number of responses form the server, I want that count. Can anyone help me out please. Thanks in advance.

开发者_StackOverflow社区

Edit: Thanks for yours answers.. I want to write a program in java to do this task. Any help?


Many browsers come with tools that will show you all of the requests going to and responses coming from a particular server. In Chrome you can find it under View > Developer > Developer Tools.

Another alternative is to use a tool like Wireshark that records all network traffic, and then allows you to filter down to specific host.

Ngrep is a command line alternative to wireshark. Here's the command to see all the relevant requests

ngrep -W byline -q "^(GET|POST).*stackoverflow"

For more information on ngrep and other related command line tools see this post.


You can use FireBug for Firefox and see how many requests are made to that site when you open it in the browser. Other browsers also have similar tools.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜