8 years of experience -- jmeter-based performance full-process testing

01. Steps for performance testing

1. Server performance monitoring

First, you need to install the performance monitoring tool on the corresponding server , such as the server under the linux system, you can choose nmon or other monitoring tools, and then start the monitoring tool at the same time when running the script in the jmeter simulation scene, so that you can get the aggregation report of jmeter and the performance report of the server, and then analyze the two reports to get the results of the performance test. (If there is an application server and a database server, then these must be monitored)

Common commands:

nmon -s 1 -c 1800 -f -m /usr/local/src/nmon/logs

The above command means continuous monitoring for 1800s. If nmon is configured according to the previous document of the author, and the path is the same, then after you can connect to the server, enter this command in any path of the server to start monitoring. After starting the monitoring, it will start to execute at the same time The jmeter script is enough, and the monitoring report of the server will be in the path of /usr/local/src/nmon/logs, which is a file in .nmon format

02. jmeter simulates performance test scenarios

Generally, it is to simulate a set of business processes, from login > data entry > calculation report, a scenario like this, and then simulate multiple concurrency, continue to cycle the scenario, test stability, etc.

If jmeter calls the associated interface and mastered it before, then you only need to master the following points:

1. Throughput controller
When you need to simulate mixed business scenarios, you need to use a throughput controller. For example, when there are many concurrency, half of the users are simulating the scene of calculating reports, and half of the users are simulating the scene of index trial calculation. Then Use the throughput controller to set the percentage, as shown in the figure below:

2. Set the number of art of war threads, the number of cycles, and the duration
. The duration is how long the jmeter script will continue to run in a loop and stop

3. Aggregation report
Here you need to fill in the path where the aggregation report is saved. The file format is .jtl, which is convenient for subsequent export (it is recommended that the report be stored in the bin folder of the jmeter installation path)

4.
There are some scenarios for generating random numbers, and you will encounter scenarios where you need to randomly input data and save it. At this time, you can also use the function assistant, select the Random function, enter the random range, and click Generate random parameters, and then input the parameters of the corresponding interface Replace it with the random parameters just generated, as shown in the figure below: (the function assistant has random numbers and random characters, etc., you can choose the corresponding function according to your needs)

After mastering the above, you can basically do a simple stress test. For the simulated mixed scene, multiple interfaces need to be called in one thread, and sometimes the interface will continue to cycle until a certain condition is met. The interface of the cycle Call once every second on average, etc. If you encounter the above situation, you may use a fixed timer , while loop controller, BeanShell post-processing program, etc., or other jmeter components, you need to learn accordingly

现在我也找了很多测试的朋友,做了一个分享技术的交流群,共享了很多我们收集的技术文档和视频教程。
如果你不想再体验自学时找不到资源,没人解答问题,坚持几天便放弃的感受
可以加入我们一起交流。而且还有很多在自动化,性能,安全,测试开发等等方面有一定建树的技术大牛
分享他们的经验,还会分享很多直播讲座和技术沙龙
可以免费学习!划重点!开源的!!!
qq群号:110685036

03. jmeter exports the aggregation report in html format

Search for "cmd" at the beginning, open the command operator as an administrator, and then switch to the bin folder of the jmeter installation path, the example is as follows:

cd/d E:\apache-jmeter-5.3\bin

Then export the html report (the file name and path should be consistent with the address where the jmeter aggregation report is stored)

jmeter -g ./testreport/202007141422.jtl -o ./testreport/202007141422

Then enter the file path where .jtl is located and open the following html file to see the corresponding report

04. nmon export server monitoring report

1. Install the nmon report analysis tool nmon_analyser_v52_1, and use it directly after decompression

2. Export the nmon report
From the test server, download the monitoring file to the local, then unzip the zip package, open the nmon analyzer v52_1.xlsm file (need to enable macros), click this button, select the report in .nmon format, and then it will be automatically generated A .xlsx file with the same name, which is the parsed report

The following are supporting learning materials. For friends who do [software testing], it should be the most comprehensive and complete preparation warehouse. This warehouse also accompanied me through the most difficult journey. I hope it can help you too!

Software testing interview applet

The software test question bank maxed out by millions of people! ! ! Who is who knows! ! ! The most comprehensive quiz mini program on the whole network, you can use your mobile phone to do the quizzes, on the subway or on the bus, roll it up!

The following interview question sections are covered:

1. Basic theory of software testing, 2. web, app, interface function testing, 3. network, 4. database, 5. linux

6. web, app, interface automation, 7. performance testing, 8. programming basics, 9. hr interview questions, 10. open test questions, 11. security testing, 12. computer basics

Information acquisition method:

Guess you like

Origin blog.csdn.net/IT_LanTian/article/details/132342671