学英语学压测:02jmeter组件-测试计划和线程组&ramp-up参数的作用

📢📢📢:先看关键单词,再看英文,最后看中文总结,再回头看一遍英文原文,效果更佳!!

关键词

|--------------------|------|------------------------|
| Functional Testing | 功能测试 | [ˈfʌŋkʃənəl ˈtɛstɪŋ] |
| Sample | 样本 | [ˈsæmpəl] |
| Listeners | 监听器 | [ˈlɪsənərz] |
| Consequence | 后果 | [ˈkɒnsɪkwəns] |
| Performance | 性能 | [pərˈfɔːrməns] |
| Stress-testing | 压力测试 | [strɛs ˈtɛstɪŋ] |
| Controllers | 控制器 | [kənˈtroʊlərz] |
| Samplers | 取样器 | [ˈsæmplərz] |
| Concurrent | 并发的 | [kənˈkɜːrənt] |
| Duration | 持续时间 | [djuˈreɪʃən] |
| Startup Delay | 启动延迟 | [ˈstɑːrtʌp dɪˈleɪ] |

测试计划:

A test plan describes a series of steps JMeter will execute when run. A complete test plan will consist of one or more Thread Groups, logic controllers, sample generating controllers, listeners, timers, assertions, and configuration elements.

The Test Plan object has a checkbox called "Functional Testing". If selected, it will cause JMeter to record the data returned from the server for each sample. If you have selected a file in your test listeners, this data will be written to file. This can be useful if you are doing a small run to ensure that JMeter is configured correctly, and that your server is returning the expected results. The consequence is that the file will grow huge quickly, and JMeter's performance will suffer. This option should be off if you are doing stress-testing (it is off by default).

If you are not recording the data to file, this option makes no difference.

You can also use the Configuration button on a listener to decide what fields to save.

线程组

Thread group elements are the beginning points of any test plan. All controllers and samplers must be under a thread group. Other elements, e.g. Listeners, may be placed directly under the test plan, in which case they will apply to all the thread groups. As the name implies, the thread group element controls the number of threads JMeter will use to execute your test. The controls for a thread group allow you to:

  • Set the number of threads
  • Set the ramp-up period
  • Set the number of times to execute the test

Each thread will execute the test plan in its entirety and completely independently of other test threads. Multiple threads are used to simulate concurrent connections to your server application.

The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen. If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds.

Ramp-up needs to be long enough to avoid too large a work-load at the start of a test, and short enough that the last threads start running before the first ones finish (unless one wants that to happen).

Start with Ramp-up = number of threads and adjust up or down as needed.

By default, the thread group is configured to loop once through its elements.

Thread Group also allows to specify Thread lifetime. Click the checkbox at the bottom of the Thread Group panel to enable/disable extra fields in which you can enter the duration of test and the startup delay You can configure Duration (seconds) and Startup Delay (seconds) to control the duration of each thread group and the after how much seconds it starts. When the test is started, JMeter will wait Startup Delay (seconds) before starting the Threads of the Thread Group and run for the configured Duration (seconds) time.

中文总结:

测试计划:

完整的测试计划由一个或多个线程组、逻辑控制器、样本生成控制器、监听器、定时器、断言和配置元素组成。

复选框"功能测试"选中后,JMeter将记录每个样本从服务器返回的数据,并将数据写入监听器中选择的文件。

线程组:

线程组元素是任何测试计划的起始点,所有控制器和取样器必须在线程组下。

其他元素(如监听器)可直接放在测试计划下,此时它们适用于所有线程组。

线程组控制JMeter执行测试的线程数。

配置选项包括设置线程数、加速时间和测试执行次数。

Ramp-up参数只在线程组第一次启动时生效,用于控制线程的启动速度。在线程组的后续循环中,Ramp-up参数不再起作用,因为所有线程已经处于运行状态。

假设你有以下配置:

  • 线程数(Number of Threads):10
  • Ramp-up时间:20秒
  • 循环次数(Loop Count):2

在这种情况下:

  • JMeter将在20秒内逐步启动10个线程,每个线程之间的启动间隔为2秒。
  • 所有线程启动后,将执行测试计划两次(循环次数为2)。
  • 在第二次循环开始时,所有线程已经启动,Ramp-up时间不会再次生效。
相关推荐
islandzzzz6 小时前
使用JMeter进行API性能压测(执行篇)
jmeter
张永清-老清6 小时前
每周读书与学习->JMeter主要元件详细介绍(三)逻辑控制器
测试工具·jmeter·压力测试·性能调优·jmeter性能测试·性能分析·每周读书与学习
xiecoding.cn6 小时前
Apache JMeter下载和安装图文教程(附安装包,适合新手)
jmeter·apache jmeter·jmeter下载·jmeter 下载·jmeter下载安装·jmeter官网下载·jmeter工具下载
胜天半月子3 天前
性能测试 | 性能测试工具JMeter直连数据库和逻辑控制器的使用
数据库·测试工具·jmeter·性能测试
网易测试开发猿6 天前
资深测试整理,性能测试-平均并发数+评估系统TPS/并发数(详情)
软件测试·软件测试工程师·jmeter·压力测试·性能测试·负载测试·jmeter性能测试
M.Blog6 天前
JMETER+ANT接口自动化测试环境搭建实战讲解
jmeter
卓码软件测评6 天前
第三方软件课题结题验收测试机构【使用JMeter的Web应用负载测试】
功能测试·jmeter·负载均衡·压力测试
程序员小远6 天前
使用Jmeter进行http接口测试
自动化测试·软件测试·python·测试工具·jmeter·http·接口测试
一个处女座的程序猿6 天前
LLMs之Deployment:guidellm的简介、安装和使用方法、案例应用之详细攻略
llm·部署·压测·负载·推理·guidellm