1. Jmeter
Introduction
Apache JMeter
It is a stress testing tool Apache
developed by the organization Java
. Used for stress testing of software, it was originally designed for Web
application testing, but later expanded to other testing areas. We can test for interface concurrency issues.
2. Environmental installation
-
1. First make sure
jdk
the environment has been installed on your computer# 查看版本 java -version
-
2. Download from the official website
JMETER
, pay attention tojdk
the versionIf you are a
window
system computer, downloadzip
the package in the following format,mac
and download the package circled in the figure below -
3. Unzip the file and run the command
-
mac
After the computer is decompressedbin
, run the command in the directorysh jmeter
-
window
The system computer can directly click onbin/jmeter.bat
the file to start
-
-
4. Configure Chinese interface
Three, simulate and test an interface
-
1. Create a thread group
-
2. Basic configuration of thread group
-
3. Create a
http
request (similarpostman
to initiate a request in)
-
4. Configuration request information
-
5. Create a listener (similar to
http
respond after initiating a request)
Fourth, configure the request header
-
1.
json
The method used to extract the login interfacetoken
-
2.
http
Set the request header in another interface and pass the token
Five, directly execute sql
statements to obtain data and test concurrency
-
1. The downloaded
mysql
package -
2. Unzip the downloaded file and
jar
copy the package inside to thejmeter/bin
directory (easy to find and not accidentally deleted) -
3.
jemeter
Create a thread group in (the same as above) -
4. Configure the
jdbc
connection
-
5. Configuration information
url
:jdbc:mysql://host:port/{dbname}?allowMultiQueries=true&serverTimezone=UTC
DriverName
:com.mysql.jdbc.Driver
-
6. Create one
JDBC Request
-
7. Configure the login interface
-
Configure the global default request
-
Configure login request interface
-
Configure the counter ( variables
sql
are used in the statement above${offset}
)
-