Linux platform running jmeter

 This blog introduces jmeter to perform pressure testing in the Linux environment. The general process is to edit the test script on the window, then copy it to run on Linux, and then get the running results on Linux to view on jmeter on windows.

Preparation

1. A Linux machine

2. Download jdk:

3. Download jmeter:

1. Configure the Linux jdk environment

1. Put the downloaded jdk into the Linux /root/java directory (pay attention to whether it is 32 or 64 bits when downloading). For example, my Linux system is 64-bit, download 64-bit jdk

2. Decompress, decompress command tar -zxvf jdk-8u191-linux-64.tar.gz

3. Configure the jdk environment variable, edit /etc/profile, and add the following configuration at the end

export JAVA_HOME=/root/java/jdk1.8.0_191
export JRE_HOME=/root/java/jdk1.8.0_191/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH

4. To make the set configuration take effect immediately, enter the command: source /etc/profile. Then enter java -version to test

 Two, configure jmeter

 1. You can directly copy the jmeter compressed package on your windows to Linux

 2. Unzip to the same directory folder, unzip command: unzip apache-jmeter-5.0.zip 

 3. Configure the jmeter environment variable, edit /etc/profile, and add this configuration: export PATH=/root/jmeter/apache-jmeter-5.0/bin:$PATH

 4. Run the command source /etc/profile to make the configuration take effect. If jmeter needs to add a plug-in, follow steps 1 and 2, and then overwrite to the root directory of jmeter.

 3. Use of jmeter command

  jmeter -n -t test.jmx -l test.jtl 

-h help -> print useful information and exit

-n non-GUI mode -> run JMeter in non-GUI mode

-t test file -> JMeter test script file to run

-l log file -> file to log results

-r remote execution -> start remote service

-H Proxy Host -> Set the proxy host used by JMeter

-P Proxy Port -> Set the port number of the proxy host used by JMeter

4. View jmeter pressure test results

1. After the test is completed, there will be a test.jtl file in the folder, copy it to the windows machine, and open jmeter on windows (Note: the jdk and jmeter versions on Linux must be consistent with those on windows, including plug-ins. to be consistent)

2. Create a new thread group and add the listeners you need to check

3. Import the test.jtl file and view the report.

 Summary Report

 

TPS

 Response time

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. Welcome everyone to click on the business card below to get it for free, don't miss it.

Guess you like

Origin blog.csdn.net/MXB1220/article/details/132364909