十五年测试老手,长期负责WEB\APP 项目测试,目前主要负责团队管理工作。
使用curl进行网络诊断
上一篇 /
下一篇 2012-02-26 16:46:31
/ 个人分类:自动化测试
Z5j%JZ@%y6x0 我们使用浏览器插件,很容易查看到网页细分请求消耗的时间。如Firefox的Firebug插件:51Testing软件测试网kx^t
LRz@(s r T|
'sEkf_/k!m051Testing软件测试网4yt R)b0W/`4d2iO
Linux的命令行怎样实现类似功能呢?curl即可实现:
|`/i;tO0|0`EXf+i*FT0/usr/bin/curl --no-keepalive --no-sessionid --noproxy -o /dev/null -s
-w'time_namelookup=%{time_namelookup}51Testing软件测试网u [-b-Aa v;y!O
time_connect=%{time_connect}51Testing软件测试网OV9b4F~rX
time_appconnect=%{time_appconnect}51Testing软件测试网NF6J
zTl jS&l_
time_pretransfer=%{time_pretransfer}51Testing软件测试网"`y/XPw
I\+Y3y)n!A'JS
time_redirect=%{time_redirect}51Testing软件测试网$iHuhMT C]
time_starttransfer=%{time_starttransfer}
+e#f Q
SQ0size_download=%{size_download}51Testing软件测试网;r-@#rW]W+V
X
size_upload=%{size_upload}51Testing软件测试网(`:[[*qvx
size_header=%{size_header}51Testing软件测试网)lt({#b.T&oT"a
size_request=%{size_request}
/in
G*D-DKK0speed_download=%{speed_download}
3N8c4g)zX0speed_upload=%{speed_upload}
{Z(J2cr5G'o0content_type=%{content_type}
gx{h
V0num_connects=%{num_connects}
/Svijra0num_redirects=%{num_redirects}51Testing软件测试网:^%m tm4Y!m1HT
redirect_url=%{redirect_url}
p:cO5eI0time_total=%{time_total}\n'http://www.baidu.com/img/baidu_sylogo1.gif
-v --trace-time
D,b0{Uw#V7o051Testing软件测试网*^o
zw2j0B[5G获取结果如下: