Basic Performance scripts
Delay time = Network time + service processing time
The response time consumption can be judged by the difference between the two listeners:
- jp@gc – Connect Times Over Time
- jp@gc – Response Times Over Time
Debug script phase, you can use the view result tree and other listeners to observe the results of the run
Disable it to avoid consuming server resources
To prepare data
Get login session for subsequent interface use:
The session is obtained from the login response and passed to be used in the request header of the subsequent interface
- Use the cookies manager
- Rear processor
Add a regular expression extractor to the login request
Debug regular expression is correct:
In the view result tree, find the corresponding request and enter the re debugging
Fill in the regular expression (determine the left and right boundaries, note whether greedy mode is used), click [test], and check the result:
Backfill the debuggable regular expression into the regular expression extractor:
Reference link: blog.csdn.net/quiet_girl/…
Extension: JSON expression debugging
Root node: $
Get the key-value pair: $. Corresponding key name
Reference links: blog.csdn.net/df0128/arti…
Get the value via a post-processor reference:
- The extracted cookie value is passed to the request header of the next request through the HTTP header manager
Second, the HTTP Cookie manager can be used to precisely pass the Cookie value of the specified user
assertions
Add a response assertion for the corresponding request:
Logic controller
Once only controller
For single-threaded multiple loops, execute only once; But in the case of multiple threads, it will be executed multiple times
Throughput controller
Requests under the throughput controller are executed a specified number of times, regardless of the number of threads
Critical Section Controller
Controls requests to be executed in the specified order
Connect to the database to obtain data
Need to use:
- JDBC Connection Configuration: Used to connect to the database
- JDBC Request: Uses SQL statements to obtain data
Reference link: blog.csdn.net/sinat_28317…
- Reference value: ${variable name}
Obtain CSV file data
CSV Data Set Config is required
Related configurations:
Refer to the link: www.cnblogs.com/sandymonk/p…
Assistant function
- Store extracted values in system properties:
- The parameterized:
Determine concurrency
Evaluation of online users: in the absence of basic data reference, 5%-10% of registered users are taken as online users
Number of online users per unit time = (Single service time x service volume)/Total service time