JMeter non-GUI mode execution test
In the actual stress test, it is strongly recommended to use the command line mode, that is, the non-GUI mode, which consumes less press resources and can support greater concurrency.
Note: if necessary, open the command prompt with administrator privileges
Restart the master or slave machine if necessary
Restart jmeter if necessary
Windows can open the command line directly in the script directory: hold down the shift key and select "Open Command window here" with the right mouse button.
The following commands apply under both windows and linux
1. Command interpretation
Jmeter-n-t xxx.jmx-r-l xxx.jtl
N indicates no GUI to run, t indicates the jmx file to be run, r refers to starting all agent remotely, and l refers to the name of the generated file
two。 Command summary
Jmeter-n-t xxx.jmx-l 001.jtl support
Jmeter-n-t xxx.jmx-r-l 001.jtl support
Jmeter-n-t xxx.jmx-Jthreads=10-l 001.jtl-these two, specify the number of threads, but do not specify the number of cycles to support
Jmeter-n-t xxx.jmx-Jthreads=10-r-l 001.jtlr-so it is not supported for a few minutes of running?
Jmeter-n-t xxx.jmx-Jthreads=10-Jloops=100-l 001.jtl support
Jmeter-n-t xxx.jmx-Jthreads=10-Jloops=100-r-l 001.jtl does not support?
Jmeter-n-t xxx.jmx-Jthreads=10-Jloops=100-l 001.jtl-e-o output
Jmeter-n-t xxx.jmx-Jthreads=10-Jloops=100-r-l 001.jtl-e-o output does not support?
Jmeter-g 002.jtl-o output
Doubt: the number of parameterized threads and cycles is not supported in non-GUI mode + distributed mode?
3. Command to use the scene
(1) jmeter-n-t xxx.jmx-l 001.jtl
After running, you can open the jtl file in jmeter to view the result.
(2) parameterize the number of threads and loops on the command line:
Modify jmeter script
Replace the specific number of threads and cycles
Add the-J parameter to the command line
Jmeter-n-t xxx.jmx-Jthreads=10-Jloops=100-l 001.jtl
(3) use commands to automatically generate HTML performance reports and charts of various metrics
Modify jmeter.properties
Jmeter.save.saveservice.output_format=csv
Jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss
Modify user.properties statistics interval
Jmeter.reportgenerator.overall_granularity=1000
There are two ways to generate HTML reports:
Generate a HTML report at the end of the stress test
Jmeter-n-t xxx.jmx-Jthreads=10-Jloops=100-l 001.jtl-e-o output
Generate HTML reports using existing result files
Jmeter-g 002.jtl-o output