学英语学压测: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时间不会再次生效。
相关推荐
卓码软件测评1 小时前
【第三方高校课题软件确认测试:LoadRunner与JMeter-企业级性能测试工具选型深度对比】
测试工具·jmeter·性能优化·单元测试·测试用例
AC赳赳老秦5 小时前
R语言数据分析:DeepSeek辅助生成统计建模代码与可视化图表
开发语言·人工智能·jmeter·数据挖掘·数据分析·r语言·deepseek
老友@5 小时前
JMeter 在 Linux 环境下进行生产级性能压测的完整实战指南
java·linux·jmeter·性能优化·系统架构·压测·性能瓶颈
老友@10 小时前
JMeter 压力测试完全指南(中文界面版,超详细小白版)
jmeter·压力测试
Mr_Xuhhh12 小时前
JMeter性能测试工具核心面试复习指南
测试工具·jmeter·面试
码出钞能力2 天前
jmeter压测笔记
jmeter
网易测试开发猿2 天前
爆肝整理,性能测试-内存问题定位分析+常见业务场景bug(汇总)
软件测试·软件测试工程师·jmeter·压力测试·性能测试·负载测试·jmeter性能测试
网易测试开发猿4 天前
吐血整理,性能测试-MySQL问题定位和分析+SQL优化(详细)
软件测试·软件测试工程师·jmeter·压力测试·性能测试·负载测试·jmeter性能测试
vHXIxsckCTh5 天前
LabVIEW中英文虚拟键盘源程序:便捷输入的利器
jmeter