JMeter: Run scripts from the console
Running Jmeter scripts from the console is one way of reducing the resources needed to execute the load as compared to a GUI mode.
From the console, we say:
jmeter -n -t <testplan filename> -l <listener filename>
(e.g. jmeter -n -t testplan.jmx -l listener.jtl)
The first time I tried to run my scripts from the command line, this is what I exactly saw:
D:\Jmeter\bin>jmeter -n -t testplan.jmx -l listener.jtl Created the tree successfully using testplan.jmx Starting the test @ Fri Oct 28 07:50:29 CST 2009 (1256255429500) Waiting for possible shutdown message on port 4445 Tidying up ... @ Fri Oct 28 07:50:34 CST 2009 (1256255434468) ... end of run
This information tells us that execution was successful. But if I wanted to see more results of the test, Jmeter provides a listener that displays the summary results also from the console where we type our commands.
We do this by adding the “Generate Summary Results” listener in our testplan.
Again we type the same command in the console:
D:\Jmeter\bin>jmeter -n -t testplan.jmx -l listener.jtl
Created the tree successfully using testplan.jmx
Starting the test @ Thu Oct 29 11:23:49 CST 2009 (1256786629265)
Waiting for possible shutdown message on port 4445
Generate Summary Results + 5 in 8.5s = 0.6/s Avg: 981 Min: 296 Max: 2344 Err: 0 (0.00%)
Generate Summary Results + 1 in 0.2s = 4.3/s Avg: 232 Min: 232 Max: 232 Err: 0 (0.00%)
Generate Summary Results = 6 in 9.6s = 0.6/s Avg: 856 Min: 232 Max: 2344 Err: 0 (0.00%)
Tidying up ... @ Thu Oct 29 11:24:02 CST 2009 (1256786642453)
... end of run
From here we could clearly see the results happening per thread which I prefer more than the first.
Here are some commands that we could use when running test in nonGUI mode:
-h, –help -> prints usage information and exit
-n, –nongui -> run JMeter in nongui mode
-t, –testfile <argument> -> the jmeter test(.jmx) file to run
-l, –logfile <argument> -> the file to log samples to
-r, –runremote -> Start remote servers (as defined in remote_hosts)
-H, –proxyHost <argument> -> Set a proxy server for JMeter to use
-P, –proxyPort <argument> -> Set proxy server port for JMeter to use
example:
jmeter -n -t test1.jmx -l logfile1.jtl -H 192.168.1.1 -P 8080
could clearly see the results per thread which I prefer more than the first.
Blog Visitors
- 371,755 views
Categories
Syndication
Archives
- February 2016 (1)
- January 2016 (1)
- February 2015 (2)
- January 2015 (1)
- July 2014 (1)
- November 2012 (2)
- October 2012 (2)
- September 2012 (1)
- June 2012 (2)
- May 2012 (2)
- April 2012 (2)
- March 2012 (2)
- January 2012 (1)
- December 2011 (1)
- November 2011 (4)
- October 2011 (2)
- September 2011 (1)
- April 2011 (2)
- March 2011 (2)
- January 2011 (1)
- September 2010 (1)
- May 2010 (1)
- April 2010 (1)
- January 2010 (1)
- November 2009 (1)
- October 2009 (1)
- September 2009 (4)
- August 2009 (2)
- July 2009 (3)
- June 2009 (2)
- May 2009 (3)
- April 2009 (1)
- March 2009 (5)
- February 2009 (5)
- January 2009 (7)
- December 2008 (2)
Recent Comments