如何在Jmeter中在不同时间与不同数量的用户一起运行 [英] How to run with various number of user at different times in Jmeter

查看:166
本文介绍了如何在Jmeter中在不同时间与不同数量的用户一起运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用10、20、30个不同的用户数量运行登录请求,并生成包含用户数量和响应时间的报告.

I want to run login request with different number of users: 10, 20, 30 and generate report with number of users, and response time.

我创建的CSV文件的线程数为:10、20、30

I created CSV file with number of threads: 10, 20, 30

我在线程"组中的线程数"中分配了线程号变量,但是它没有运行.

I assigned thread number variable into Number of Thread in Thread group but it does not run.

推荐答案

您需要使用属性,并使用不同的属性值,例如10个线程

You need to use property, call JMeter batch with different property value, with 10 threads for example

jmeter -JthreadNum=10 -t myJmx.jmx 

在测试计划中,在线程数"中获取该属性:

And in your Test Plan get the property in your Number of Threads:

${__P(threadNum)}

请注意,该函数的默认值为1,因此即使您未发送任何值,该函数也可以工作(具有1个线程).

Notice that the default of the function is 1 so it'll work (with 1 thread) even if you didn't sent any value.

使用threadNum=10行添加属性文件并调用命令行选项以覆盖或添加JMeter属性文件的其他解决方案:

Other solution to add property file with threadNum=10 line with calling command line options to either override or add JMeter property file:

-p, --propfile <argument>
    the jmeter property file to use
-q, --addprop <argument>
    additional JMeter property file(s)

根据您的情况,添加到命令行-q myprop.properties

In your case, add to command line -q myprop.properties

这篇关于如何在Jmeter中在不同时间与不同数量的用户一起运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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