如何平均增加3个线程组中的用户数量,以节省它们之间的请求比例? [英] How to evenly increase number of users in 3 Thread Groups saving proportion of requests between them?

查看:110
本文介绍了如何平均增加3个线程组中的用户数量,以节省它们之间的请求比例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的测试计划中有3个线程组. 这些线程组必须具有固定的请求权重(例如1st-50%,2nd-40%,3rd-10%). 如果我需要模拟恒定数量的用户,请参阅本文中的解决方案如果将循环计数"设置为数字(1、10、100等),则@ PMD UBIK-INGENIERIE 的效果很好.但是问题是,当我为循环计数"设置永远"复选框时,组之间的比例被破坏了.

I have 3 Thread Groups in my test plan. These Thread Groups must be with fixed request weights (for example 1st-50%, 2nd-40%, 3rd-10%). If I need to emulate constant number of users, the solution in this post which was given by @PMD UBIK-INGENIERIE works good if I set Loop Count as number (1, 10, 100 ect.). But the problem is when I set the check-box "forever" for Loop Counts, the proportion between groups is broken.

现在,我需要增加用户数量,保存3个组之间的请求比例,以进行容量评估. 这3个小组必须以50-40-10的恒定比例均匀地发送请求.

Now I need to increase the amount of users, saving proportion of requests between my 3 groups, to perform the capasity assessment. All 3 groups must send requests evenly, in this constant proportion 50-40-10.

如果我使用步进线程组,则可以平均增加每个用户的数量,但是无法设置对他们的请求比例.

If I use Stepping Thread Group, I can evenly increase number of users in each of them, but I can't set the proportion of request for them.

您能告诉我任何想法吗,怎么做?

Could you please tell me any idea, how to do this?

UPD1.

我的设置截图:

怎么了?

UPD2.最后一个变量(我为每个组手动设置了数字)是(线程组1-50%):

UPD2. The last variant (I have put numbers manually for each group) is (Thread Group1 - 50%):

推荐答案

想法与 PMD UBIK-INGENIERI的答案相同.

  1. 在用户定义的变量"或测试计划变量"中设置USERS变量(或可以通过命令行传递它).
    还设置变量:

  1. Set USERS variable in User Defined Variables or test plan variables (or you can pass it through command line).
    Also set variables:

PERCENT1 to 0.5
PERCENT2 to 0.4
PERCENT3 to 0.1

  • 添加3个步进线程组:

  • Add 3 stepping thread groups with:

    该组将开始"设置为

    ${__BeanShell(Math.round(${PERCENT1}*${USERS})}
    ${__BeanShell(Math.round(${PERCENT2}*${USERS})}
    ${__BeanShell(Math.round(${PERCENT3}*${USERS})}
    

    然后开始"设置为:

    ${__BeanShell(Math.round(${PERCENT1}*${USERS}/10)}
    ${__BeanShell(Math.round(${PERCENT2}*${USERS}/10)}
    ${__BeanShell(Math.round(${PERCENT3}*${USERS}/10)}
    

    如果USERS变量的值可以除以100,它将起作用

    It will work if value of USERS variable can be divided by 100

    这篇关于如何平均增加3个线程组中的用户数量,以节省它们之间的请求比例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆