Use jmeter to record website performance test scripts

Source: Internet
Author: User
Tags http cookie website performance
1. Recording Script: (1) Right-click test plan and choose add> thread group from the pop-up menu; (2) Right-click workbench, choose add-> non-test elements-> HTTP Proxy server in the pop-up menu; (3) in the "HTTP Proxy Server" window, select test plan> thread group in the target controller drop-down box (indicating that the script is generated in this thread group ), select put each group in a new controller in the grouping drop-down box (put each group of scripts in a new group to prevent the generated scripts from being messy and unorganized). (4) click Start at the bottom of the window. (5) Open the browser and set the configuration of the proxy server to localhot, the port number is 8080 (port 8080 is set in the "HTTP Proxy Server" window); (6) in the address, Type To record the page url, jmeter automatically records the operation as a script, we can see that many subnodes under the thread group node are the recorded scripts. (7) after the operation is completed, click stop in jmeter to stop recording, then, change the proxy settings of the browser to the original settings.

 

 

2. Run and record result settings: (1) After recording the script, you must define the result settings you need to complete the test plan settings, first, set the attributes of thread group (equivalent to virtual user group), click thread group, and set number of threads (equivalent to the number of virtual users) to 5 in the window on the right, ramp-up period (in seconds) is 1, the loop cout option deselect forever, and enter 2 in the box on the right. The preceding settings indicate a total of five virtual users, which run once every 1 second and iterate twice. (2) To view the running results, add a listener. Right-click the thread group and choose listener> View results in table, you can view the execution status of each link in this view, including the execution time and success or not, and then add the aggregate report, this view allows you to view the maximum, minimum, and average response time of each thread group. Add view results tree to view the execution status of each link, including the sent request and details returned by the server.

 

 

View results in Table check the execution status of each link, including the execution time and success or failure
aggregate Report View the maximum, minimum, and average response time of each thread group
View results tree View the execution status of each link, including the sent request and details returned by the server

 

 

Add cookie support

Almost all web tests require the use of cookies unless your Program Specifically, do not use cookies. To add cookie support, add the HTTP cookie manager to each thread group. This ensures that each thread obtains its own cookie, but shares all HTTP request objects.
Add HTTP cookie manager, click thread group, and then select Add HTTP cookie manager.

 

 

 

 

Number of samples: number of sample response results obtained during running
Latest sample: response time of the last sample result
Average: average response time of all sampling results
Deviation: Standard deviation of response time for all sampling results
Throughput: the number of sample results returned per minute
Median value: the median value in the response time of all sampling results.
PS:
The standard deviation is the arithmetic square root of the variance. Like the variance, it is also a measure of the fluctuation of a set of data.
Formula for Calculating variance s ^ 2 = (1/n) [(X1-X) ^ 2 + (X2-X) ^ 2 +... (Xn-x) ^ 2]
X is the arithmetic mean of this set of data (it should be the average mentioned above ).
So standard deviation S = √ {(1/n) [(X1-X unplug) ^ 2 + (X2-X unplug) ^ 2 +... (Xn-x) ^ 2]}
The standard deviation reflects the degree of discretization of a dataset.

 

 

 

Generally, the larger the standard deviation, the larger the differences between individual samples. It may indirectly indicate the instability of the system (excluding external interference ). My personal understanding may be wrong. If you want to understand it in depth, we suggest you read the probability statistics book. I forgot about it.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.