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

server/2025/1/8 19:59:34/

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

关键词

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时间不会再次生效。


http://www.ppmy.cn/server/156868.html

相关文章

SpringBoot安装及配置

1 Spring Boot介绍 Spring让Java程序更加快速, 简单和安全. Spring对于速度、简单性和⽣产⼒的关注使其成为世界上最流⾏的Java框架。 这些项⽬都是基于Spring Framework来进⾏开发的, 但是Spring Framework存在配置多, ⼊⻔难的问题, Spring 也意识到了这个问题, 为了简化开…

电脑硬盘系统迁移及问题处理

一、系统迁移准备 1、确认你的电脑主板是否支持安装两块硬盘,如电脑主板有多个M2硬盘接口,我们将新硬盘安装到主板上,原来的老硬盘安装在第二个接口上,主板只有一个M2接口的话可以使用移动硬盘盒。 2、新硬盘安装好后,我们进入原来的系统,在 此电脑–右键–管理–磁盘管…

英伟达 RTX 5090 显卡赋能医疗大模型:变革、挑战与展望

一、英伟达 RTX 5090 与 RTX 4090 技术参数对比 1.1 核心架构与制程工艺 在探讨英伟达 RTX 4090 与 RTX 5090 的差异时,核心架构与制程工艺无疑是最为关键的基础要素,它们从根本上决定了两款显卡的性能上限与应用潜力。 1.1.1 核心架构差异 RTX 4090…

计算机网络——数据链路层-流量控制和可靠传输

一、流量控制 流量控制是指由接收方及时控制发送方发送数据的速率,使接收方来得及接受。 • 停止等待流量控制 • 滑动窗口流量控制 1、停止—等待流量控制 停止-等待流量控制的基本原理是发送方每发出一帧后,就要等待接收方的应答信号&#xff…

关于Redis的面试题目及其答案

什么是Redis? Redis是一个开源的、基于键值对存储的NoSQL数据库,常用于缓存、会话存储和消息队列系统。 Redis为什么这么快? Redis之所以快是因为它使用内存作为主要存储介质,并且采用了单线程模型避免了多线程的上下文切换开销。…

HCIA-Access V2.5_8_1_EPON原理_PON基本概念

前言 考虑到未来许多带宽的应用,越来越多的国家认识到必须尽早突破接入瓶颈,铜缆的xDSL技术已经走到了尽头,而光纤是迄今发现的最好的传输介质,所以PON网络的应用也是越来越多,本章主要介绍EPON系统原理及相关技术&…

【力扣热题100】—— Day18.将有序数组转换为二叉搜索树

期末考试完毕,假期学习开始! —— 25.1.7 108. 将有序数组转换为二叉搜索树 给你一个整数数组 nums ,其中元素已经按 升序 排列,请你将其转换为一棵平衡二叉搜索树。 示例 1: 输入:nums [-10,-3,0,5,9] …

CANN 学习——基于香橙派 KunpengPro(1)

异构计算架构CANN(Compute Architecture for Neural Networks)是昇腾针对AI场景推出的异构计算架构,向上支持多种AI框架,包括MindSpore、PyTorch、TensorFlow等,向下服务AI处理器与编程。 1CANN 总体架构 CANN 软件架…