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

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

问题描述

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

我用线程数创建了 CSV 文件:10、20、30

我将线程编号变量分配到线程组中的线程数中,但它没有运行.

解决方案

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

jmeter -JthreadNum=10 -t myJmx.jmx

并在您的测试计划中获取线程数中的属性:

${__P(threadNum)}

请注意,该函数的默认值是 1,因此即使您没有发送任何值,它也会工作(使用 1 个线程).

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

<块引用>

-p, --propfile <参数>要使用的 jmeter 属性文件-q, --addprop <参数>额外的 JMeter 属性文件

在你的情况下,添加到命令行 -q myprop.properties

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

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.

解决方案

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)}

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

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)

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

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

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