1. Download
: Apache Jmeter
Unzip, double-click Jar or BAT to open (need to install Java environment), directory:. \apache-jmeter-4.0\bin\apachejmeter.jar
2. Basic use
After opening the first page:
How do I perform basic interface testing?
1. Create a thread group
2. Add an HTTP request
3. Add "view result tree" and aggregated report (summary)
View results tree to see the results of each request
Aggregated reports can see some of the aggregated results of the impersonation request, with the following parameters
#Samples: Indicates how many requests you have made in this test, and if you simulate 10 users, each user iterates 10 times, then this shows a 100
Average: Average response time--the average response time of a single Request by default, or the average response time in Transaction when a Transaction Controller is used
Median: Median, which is the response time of 50% users
90% line:90% User's response time
Min: Minimum response time
Max: Maximum response time
error%: Number of requests with errors in this test/total number of requests
Throughput: Throughput--By default, the number of requests completed per second (request per Second), when Transaction Controller is used, can also represent LoadRunner-like Transaction per Number of Second
Kb/sec: The amount of data received from the server side per second, equivalent to throughput/sec in LoadRunner
Demo sample
1. Create a project
Create a local spring boot demo, interface path: 127.0.0.1:8080, return data self-fitting, my following
@Slf4j@RestControllerpublicclass UserController { @RequestMapping("/") publichome(){ User user = newUser(); user.setId(1L); user.setName("飞翔的大白菜(●—●)"); user.setDescription("像一颗海草海草海草,随波飘摇~"); log.info("用户请求了一次(●—●),好开森(* ̄︶ ̄)"); return user; }}
2.JMeter configuration access to the request
3. Set Thread group parameters: number of threads, period duration (seconds), number of cycles
4. Execute the test plan, view the aggregated report (click to save the results to the file, do not want to save can click Cancel, the test plan will still be executed)
The results of my execution, you can see the test results of the interface according to the indicators in the report.
Apache JMeter 01-Downloads and basic usage