Showing posts with label Jmeter. Show all posts
Showing posts with label Jmeter. Show all posts

Saturday, July 17, 2010

acme网站上几个http小工具

1. http_load: http://www.acme.com/software/http_load/

同apache ab和JMeter一样可以对数据库和web服务器作压力测试。
$> vi urls


$> ./http_load -rate 5 -seconds 10 urls
49 fetches
2 max parallel
289884 bytes
in 10.0148 seconds 5916 mean bytes/connection 4.89274 fetches/sec
28945.5 bytes/sec msecs/connect: 28.8932 mean
44.243 max
24.488 min msecs/first-response: 63.5362 mean
81.624 max
57.803 min
HTTP response codes: code 200 -- 49

2. http_ping: http://www.acme.com/software/http_ping/

与ping命令类似,但是是通过http请求来检查服务器,而非ICMP请求服务器返回响应。

$> http_ping http://www.example.com/
7816 bytes from http://www.example.com/:
246.602 ms (9.923c/23.074r/213.605d)
7816 bytes from http://www.example.com/:
189.997 ms (11.619c/22.971r/155.407d)
7816 bytes from http://www.example.com/:
190.463 ms (8.994c/25.091r/156.378d)
7816 bytes from http://www.example.com/:
190.07 ms (9.234c/23.9r/156.936d)
7816 bytes from http://www.example.com/:
190.706 ms (10.142c/46.579r/133.985d)
--- http://www.example.com/
http_ping statistics
--- 5 fetches started, 5 completed (100%), 0 failures (0%), 0 timeouts (0%)
total min/avg/max = 189.997/201.568/246.602 ms
connect min/avg/max = 8.994/9.9824/11.619 ms
response min/avg/max = 22.971/28.323/46.579 ms
data min/avg/max = 133.985/163.262/213.605 ms

Sunday, April 22, 2007

JMETER 命令行运行及JTL的LOG查看

Jmeter full list of command-line options

Invoking JMeter as "jmeter -?" will print a list of all the command-line options. These are shown below.


-h, --help
print usage information and exit
-v, --version
print the version information and exit
-p, --propfile {argument}
the jmeter property file to use
-q, --addprop {argument}
additional property file(s)
-t, --testfile {argument}
the jmeter test(.jmx) file to run
-l, --logfile {argument}
the file to log samples to
-n, --nongui
run JMeter in nongui mode
-s, --server
run the JMeter server
-H, --proxyHost {argument}
Set a proxy server for JMeter to use
-P, --proxyPort {argument}
Set proxy server port for JMeter to use
-u, --username {argument}
Set username for proxy server that JMeter is to use
-a, --password {argument}
Set password for proxy server that JMeter is to use
-J, --jmeterproperty {argument}={value}
Define additional JMeter properties
-D, --systemproperty {argument}={value}
Define additional System properties
-S, --systemPropertyFile {filename}
a property file to be added as System properties
-L, --loglevel {argument}={value}
Define loglevel: [category=]level
e.g. jorphan=INFO or jmeter.util=DEBUG
-r, --runremote
Start remote servers from non-gui mode
-d, --homedir {argument}
the jmeter home directory to use

C:\jmeter\bin>jmeter -n -t test.jmx -l test.jtl
Created the tree successfully
Starting the test
Tidying up ...
... end of run

上面的jmx文件是用Jmeter控制台生成的。详见官方文档:http://wiki.apache.org/jakarta-jmeter/UserManual/BuildWebTest
命令行运行后生成jtl的LOG文件之后需要在Jmeter控制台里任意添加一个 Listener ,然后点击“Browse” 按钮,选择要查看的 jtl 文件。不过中文看到的"HTTP请求"这里的中文字乱码了。