当放置Constant Timer于两个http请求之间,那么它代表的含义是:在上一个请求发出至完成后,

开始Contant Timer指定的时间,最后再发出第二个请求.它并不是代表两个请求之间的发送间隔时间

图中的19.701第一个请求发出,经过1.36s时间完成接收,再等待Constant Timer的1s,再开始第二个请求

设置QPS限制

本次性能测试的需求中提到测试的目的是“了解博客的首页在负载达到20 QPS时的响应时间”,因此需要控制向博客首页发送请求的负载为20QPS。

  一种可行的方法是逐步调整测试计划中的线程计算的数量以及为取样器(Sampler)添加定时器(Timer),以使HTTP取样器发出的请求的QPS保持在20个左右。

但这种方法耗时耗力,需要经过多次尝试才能达到;另一方法,完全通过设置定时器来控制QPS,一旦取样器的响应时间发生改变(网络环境发生改变),就需要重新调整定时器的等待时间。

  Jmeter提供了一个非常有用的定时器,称为Constant Throughput Timer (常数吞吐量定时器),该定时器可以方便地控制给定的取样器发送请求的吞吐量。

  右键点击fnng.cnblogs.com ,弹出菜单(添加--->定时器--->Constant Throughput Timer)选择Constant Throughput Timer

Constant Throughput Timer 的主要属性介绍:

名称 :定时器的名称

Target throughput(in samples per minute):目标吞吐量。注意这里是每分钟发送的请求数,因此,对应测试需求中所要求的20 QPS ,这里的值应该是1200 。

Calculate Throughput based on :有5个选项,分别是:

  This thread only :控制每个线程的吞吐量,选择这种模式时,总的吞吐量为设置的 target Throughput 乘以矣线程的数量。

  All active threads : 设置的target Throughput 将分配在每个活跃线程上,每个活跃线程在上一次运行结束后等待合理的时间后再次运行。活跃线程指同一时刻同时运行的线程。

  All active threads in current thread group :设置的target Throughput将分配在当前线程组的每一个活跃线程上,当测试计划中只有一个线程组时,

该选项和All active threads选项的效果完全相同。

  All active threads (shared ):与All active threads 的选项基本相同,唯一的区别是,每个活跃线程都会在所有活跃线程上一次运行结束后等待合理的时间后再次运行。

  All cative threads in current thread group (shared ):与All active threads in current thread group 基本相同,唯一的区别是,

每个活跃线程都会在所有活跃线程的上一次运行结束后等待合理的时间后再次运行。

  如上图,该元件仅作用于fnng.cnblogs.com ,设置定时器的Target throughput为1200/分钟(20 QPS),设置Calculate Throughput based on 的值为All active threads 。

  当然,Constant Throughput Timer只有在线程组中的线程产生足够多的request 的情况下才有意义,因此,即使设置了Constant Throughput Timer的值,也可能由于线程组中的线程数量不够,或是定时器设置不合理等原因导致总体的QPS不能达到预期目标。

转自:https://www.cnblogs.com/111testing/p/6729551.html

Jmeter之Constant Timer与constant throughput timer的区别(转)的更多相关文章

  1. Jmeter Constant Throughput Timer 使用

    Jmeter提供了一个非常有用的定时器,称为Constant Throughput Timer (常数吞吐量定时器),该定时器可以方便地控制给定的取样器发送请求的吞吐量. 右键点击fnng.cnblo ...

  2. Jmeter之Constant Timer与constant throughput timer的区别

    当放置Constant Timer于两个http请求之间,那么它代表的含义是:在上一个请求发出至完成后, 开始Contant Timer指定的时间,最后再发出第二个请求.它并不是代表两个请求之间的发送 ...

  3. Jmeter定时器:Precise Throughput Timer使用

    百度上这方面资料很少,google上有一些,我试着总结一下. Precise Throughput Timer 是Jmeter4.0添加的新功能,直接摘录一段英文: The Precise Throu ...

  4. Delphi - 闲来无事,自己写个Timer玩玩(多线程Timer)

    明天去坐火车,回家,今天就没有事做,本来在弄一个跨进程获取其他程序里面组件,如ListView,ListBox,Button等的信息,突然有个想法自己写个Timer,不用SetTimer函数,我们自己 ...

  5. System.Windows.Forms.Timer、System.Timers.Timer、System.Threading.Timer的 区别和用法

    System.Windows.Forms.Timer执行的时候,如果你在过程中间加一个sleep整个的界面就死掉了,但是另外两个没有这个情况,System.Timers.Timer.System.Th ...

  6. 定时器:Timer:System.Threading.Timer类(转)

    最近的一个项目有一些地方需要用到定时功能,在设计过程中,突然发现.net的Timer类居然还有很多我以前没有用过的功能,这里就跟大家分享一下 注:这里的Timer类特指System.Threading ...

  7. storm定时器timer源码分析-timer.clj

    storm定时器与java.util.Timer定时器比较相似.java.util.Timer定时器实际上是个线程,定时调度所拥有的TimerTasks:storm定时器也有一个线程负责调度所拥有的& ...

  8. System and method for controlling switching between VMM and VM using enabling value of VMM timer indicator and VMM timer value having a specified time

    In one embodiment, a method includes transitioning control to a virtual machine (VM) from a virtual ...

  9. System.Windows.Forms.Timer、System.Timers.Timer、System.Threading.Timer的差别和分别什么时候用

    System.Windows.Forms.Timer.System.Timers.Timer.System.Threading.Timer的 区别和用法http://space.itpub.net/1 ...

随机推荐

  1. [福大软工] Z班 团队Alpha阶段成绩汇总

    团队成绩汇总表 团队 T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 总分 Dipper 9 85 90 26 42 27.5 120 74 25 111 19 628.5 SW ...

  2. 寒假特训——搜索——H - Nephren gives a riddle

    What are you doing at the end of the world? Are you busy? Will you save us? Nephren is playing a gam ...

  3. java发送163邮件

    在服务挂掉后,可以采用发送邮件的方式来通知开发人员进行异常处理 import java.io.IOException; import java.util.Properties; import java ...

  4. .net core 2.1 Razor 超快速入门

    以下过程如有不明白的,可参考:https://docs.microsoft.com/zh-cn/aspnet/core/tutorials/razor-pages/?view=aspnetcore-2 ...

  5. UVA11093-Just Finish it up(思维)

    Problem UVA11093-Just Finish it up Accept: 1225  Submit: 5637Time Limit: 3000 mSec Problem Descripti ...

  6. 构建企业 YUM仓库

    构建企业 YUM仓库 本地光盘提供基础软件包Base yum缓存提供update软件包 yum缓存提供常用软件包: nginx, zabbix, docker, saltstack 环境准备 系统 I ...

  7. 微信接入arduino

    https://blog.csdn.net/liudongdong19/article/details/81072857 一.准备工作.      1.微信公众号,个人的就可以了,不用企业号什么的.  ...

  8. ubuntu 学习

    参考博客:http://www.cnblogs.com/resn/p/5800922.html 在Linux 里一切皆文件 / : 根 查看是否安装了中文支持:locale -a 如果有zh_CN.u ...

  9. Linux 系统负载查询及分析说明

    Linux 系统出现死机或卡顿时,可以参阅如下步骤进行整体排查: 检查服务器进程与服务否占用了过多内存,或者内存没有正常释放,导致出现内存溢出,系统宕机. 检查 /var/spool/cron 等系统 ...

  10. SimpleDialogBox

    import 'package:flutter/material.dart';import 'dart:ui';import 'dart:async';enum Option{A,B,C}void m ...