jmeter notes
The use of jmeter
If you don’t like it, don’t comment. I’m currently only writing about what I’ve come across, and will continue to update in the future.
1. The interface can be adjusted
1. Create thread groups, requests and parameter meanings
step1: Create a thread group before creating a request: test Plan
Right-click add ->Treads(Users)->Tread Group
the thread group interface:
The meaning of each parameter of the thread group is as follows: Todo time is limited and will be added later.
step2: Create an http request.
Create a request in the jmeter thread group: right-click add ->Sampler -> HTTP Request
the get request interface. The infographic that needs attention is marked:
The get request parameters are in the form of key-value
pairs in the post request interface. The parameters are passed by Body Data in json format. Then httpRequest passes the value GET and adjusts it to POST.
step3: Create response assertion
Add response assertion in jmeter thread group:Add ->. Assertions -> Response Assertion
step4: Create an http header information manager.
Right-click on the jmeter thread group and add the http header information manager: Add -> Config Element ->HTTP Header Manager
content settings:
step5: Create a result tree and aggregation report.
Right-click on the jmeter thread group and add a result tree:Add -> Listener -> View Result Tree
The result tree will be responsible for displaying the results of sending requests. The interface:
Right-click on the jmeter thread group to add an aggregation report: Add -> Listener -> Summary Report
the aggregation report displays the number of requests, qps, average response time, throughput and other information, mainly based on the interface calling situation.
2、demo
Thread group settings:
Request content settings:
Assertion:
Information header manager:
Click to execute:
View execution results in the result tree:
Aggregation report can view execution results, including request number sample, average value, tp90, tp95, tp99 minimum value, maximum value value, error rate, throughput and other information.
2. Used for pressure testing
Another way for jmeter to run scripts is to do interface testing by executing commands.
It can be executed locally: jmeter -n -r test.jmx -l test.jtl -e -o /xx/xx/resultReport
It also supports execution in the Linux environment:jmeter -n -r test.jmx -r -l test.jtl -e -o /xx/xx/resultReport
For the execution of the command, please refer to: jmeter stress test