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请求"这里的中文字乱码了。

No comments :