(转)测试网页响应时间的shell脚本[需要curl支持]
用法及返回结果如下:
lvyaozu@lvyaozu-desktop:~/shell$ ./requesturl.sh -n20 http://www.baidu.com
Request url: http://www.baidu.com
Request number: 20
Request Failed: 0
——Average Value——
time_connect: 0.1614
time_total: 0.1693
time_namelookup: 0.0088
————————-
请求参数:
-n 指定发送多少次请求,默认为10
返回结果为 curl -w 选项返回值,以下摘自curl官方文档:
http://curl.haxx.se/docs/manpage.html
time_connect The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed.
time_total The total time, in seconds, that the full operation lasted. The time will be displayed with millisecond resolution.
time_namelookup The time, in seconds, it took from the start until the name resolving was completed.
?
?
?
??
?
?
?