每个线程具有不同参数的 JMeter 测试计划

发布于 2024-12-11 02:47:25 字数 226 浏览 0 评论 0原文

我需要使用 JMeter 测试网络服务。 我已经使用线程组 500 创建了测试计划。 我需要为每个线程传递新的参数值。 我听说过“CSV 数据集配置”,但它不允许我想要的,因为如果我设置“共享模式”=“所有线程”,那么每个线程将尝试从文件的每一行读取 - 我想通过文件中的第一个值用于第一个线程,第二个值用于第二个线程,依此类推。当然,我可以用一行创建 500 个文件,但这种方法既愚蠢又缓慢。 我怎样才能以最好的方式做到这一点?谢谢。

I need to test web-srvice with JMeter.
I've created test plan with Thread-group 500.
I need to pass for each thread new value of parameter.
I've heard about "CSV Data Set Config", but it doesn't allow what I want, because if I set "Sharing mode" = "All threads" then each thread will try to read from file each row - I want pass first value in file for first thread, second value for second thread and so on. Of course I can create 500 files with one line but this approach is stupid and slow.
How can I do that in best way? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独孤求败 2024-12-18 02:47:25

如果我理解正确的话,您希望线程 1 读取 row1,线程 2 读取 row2,从而为每个线程提供 CSV 文件中的唯一值。这正是“ALL THREADS”的作用。您可以使用调试控制器来验证这一点。

http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config

* All threads - (the default) the file is shared between all the threads.
* Current thread group - each file is opened once for each thread group in which the element appears
* Current thread - each file is opened separately for each thread
* Identifier - all threads sharing the same identifier share the same file. So for example if you have 4 thread groups, you could use a common id for two or more of the groups to share the file between them. Or you could use the thread number to share the file between the same thread numbers in different thread groups.

If I understand correctly, you want thread1 to read row1 and thread2 to read row2, thus giving each thread a unique value from the CSV file. This is exactly what "ALL THREADS" does. You can use a debug controller to verify this.

http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config

* All threads - (the default) the file is shared between all the threads.
* Current thread group - each file is opened once for each thread group in which the element appears
* Current thread - each file is opened separately for each thread
* Identifier - all threads sharing the same identifier share the same file. So for example if you have 4 thread groups, you could use a common id for two or more of the groups to share the file between them. Or you could use the thread number to share the file between the same thread numbers in different thread groups.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文