Detailed explanation of jmeter command line operation (non-GUI form) parameters

Table of contents

1. JMete execution method

2. Advantages of JMete non-GUI operation

Three, jmeter non-GU operating parameters

Four, jmeter non-GUI run command

4.1 Non-GUI basic command format:

4.2 Non-GUI and generate html report basic command format

Summarize:


1. JMete execution method

Under normal circumstances, we will open the jmeter writing interface in the form of a page, and perform pressure testing. But if you want to run jmeter stress test in an automated way, it cannot be realized in the form of an interface, and many Linux servers do not have an interface (non-GUI), which requires us to run jmeter in a non-gui form

2. Advantages of JMete non-GUI operation

The JMeter visual interface and the dynamic display results of the listener both consume load machine resources. In the case of large concurrency, the GUI method often leads to load machine resource constraints, which will affect the performance test results. We only have to add more machines to run the test plan (distributed test), so that one load machine becomes two. So it is recommended to run the test plan in a non-GUI way. Although the non-GUI mode does not display the interface, it will also periodically display the execution results in the form of characters, which will consume less resources on the load machine. Under all the same conditions, the non-GUI mode jmeter machine can generate more load than the GUI mode jmeter machine. The generated load is larger.

 

Three, jmeter non-GU operating parameters

Parameter Description:

  • -n command line mode
  • -t specifies the jmx script address (the address can be a relative path or an absolute path)
  • -h View help
  • -v View version
  • -p Specifies to read jmeter property files, such as those set in the jmeter.properties file
  • -l The file that records the test results, usually the result file is in jtl format (the file can be a relative path or an absolute path)
  • -s Run as a server (also remotely, start Agent)
  • -H Set the proxy, generally fill in the proxy IP
  • -P set proxy port
  • -u proxy account
  • -a proxy password
  • -J defines jmeter properties, which is equivalent to setting in jmeter.properties
  • -G defines jmeter global properties, which is equivalent to setting in Global.properties, and can be shared between threads)
  • -D defines system properties, which is equivalent to setting in system.properties
  • -S Load the system property file, you can specify to load a system property file through this parameter, this file can be defined by the user
  • -L defines the jmeter log level, such as debug, info, error, etc.
  • -j Specify the execution log path. (The parameter is the log path, if it does not exist, it will not be created automatically, and the log will be output to the command line console)
  • -r Turn on the remote load machine, the list of remote machines is specified in jmeter.properties
  • -R Open the remote load machine, you can specify the IP of the load machine, which will override the remote_hosts settings in jmeter.properties
  • -d specifies the Jmeter Home directory
  • -X stop remote execution
  • -g specifies the test result file path, which is only used to generate test reports, and the parameter is the csv result file
  • -e Set the test report to be generated after the test is completed
  • -o specifies the test report generation folder (the folder must exist and be an empty folder)

Four, jmeter non-GUI run command

4.1 Non-GUI basic command format:

jmeter -n -t baidu.jmx

chenshifengdeMacBook-Pro:~ chenshifeng$ jmeter -n -t baidu.jmx -l baidulog.jtlCreating summariser <summary>Created the tree successfully using baidu.jmxStarting standalone test @ Fri Feb 19 18:07:30 CST 2021 (1613729250217)Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445summary +      1 in 00:00:01 =    0.9/s Avg:   836 Min:   836 Max:   836 Err:     0 (0.00%) Active: 5 Started: 5 Finished: 0summary +    376 in 00:00:29 =   13.2/s Avg:   381 Min:   318 Max:   938 Err:     0 (0.00%) Active: 5 Started: 5 Finished: 0summary =    377 in 00:00:30 =   12.7/s Avg:   382 Min:   318 Max:   938 Err:     0 (0.00%)summary +    381 in 00:00:30 =   12.7/s Avg:   392 Min:   312 Max:  1824 Err:     0 (0.00%) Active: 5 Started: 5 Finished: 0summary =    758 in 00:01:00 =   12.7/s Avg:   387 Min:   312 Max:  1824 Err:     0 (0.00%)summary +    397 in 00:00:30 =   13.2/s Avg:   378 Min:   285 Max:  1135 Err:     0 (0.00%) Active: 5 Started: 5 Finished: 0summary =   1155 in 00:01:30 =   12.9/s Avg:   384 Min:   285 Max:  1824 Err:     0 (0.00%)summary +    404 in 00:00:30 =   13.5/s Avg:   370 Min:   261 Max:   875 Err:     0 (0.00%) Active: 5 Started: 5 Finished: 0summary =   1559 in 00:01:59 =   13.0/s Avg:   380 Min:   261 Max:  1824 Err:     0 (0.00%)

Generated test report can be opened in Jmeter using aggregated report

4.2 Non-GUI and generate html report basic command format

jmeter -n -t baidu.jmx -l baidulog1.jtl -e -o log

jmeter -n -t baidu.jmx -l baidulog1.jtl -e -o output/Creating summariser <summary>Created the tree successfully using baidu.jmxStarting standalone test @ Fri Feb 19 19:02:37 CST 2021 (1613732557435)Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445summary =     50 in 00:00:02 =   20.2/s Avg:   139 Min:    43 Max:   643 Err:     0 (0.00%)Tidying up ...    @ Fri Feb 19 19:02:40 CST 2021 (1613732560194)... end of run

After the execution is complete, open the index file in the generated file directory with a browser, and the effect is shown as follows:

Summarize:

Thanks to everyone who read my article carefully! ! !

 I personally sorted out some technical materials I have compiled in my software testing career in the past few years, including: e-books, resume modules, various job templates, interview books, self-study projects, etc. Everyone is welcome to leave a message in the comment area 333 to get it for free, don't miss it.

                                                                   

Guess you like

Origin blog.csdn.net/MXB_1220/article/details/131712175