JMeterをLinuxで走らせる - Non-GUIモード
JMeterのテストスクリプトを、Linuxのコマンドから実行する方法です。
Windowsからじっくりテストスクリプトを練っておいて、実行はLinuxサーバーで。といった使い方ができて便利です。
テスト計画 mytest.jmx を実行する例。
# cd /usr/local/jakarta-jmeter-2.3.4/bin # chmod +x jmeter # ./jmeter -n -t mytest.jmx Created the tree successfully using mytest.jmx Starting the test @ Sun Nov 15 22:16:43 JST 2009 (1258291003413) Waiting for possible shutdown message on port 4445
オプションは公式ドキュメントに載っていました。
2.4.3 Non-GUI Mode (Command Line mode)
For non-interactive testing, you may choose to run JMeter without the GUI. To do so, use the following command options
-n This specifies JMeter is to run in non-gui mode
-t [name of JMX file that contains the Test Plan].
-l [name of JTL file to log sample results to].
-r Run the test in the servers specified by the JMeter property "remote_hosts"
-R [list of remote servers] Run the test in the specified remote servers
The script also lets you specify the optional firewall/proxy server information:
-H [proxy server hostname or ip address]
-P [proxy server port]Example : jmeter -n -t my_test.jmx -l log.jtl -H my.proxy.server -P 8000
Apache JMeter - User's Manual: Getting Started