如何使用 CSV Config Set 的共享模式在 Jmeter 中运行线程? [英] How to use CSV Config Set's sharing mode to run thread in Jmeter?

查看:15
本文介绍了如何使用 CSV Config Set 的共享模式在 Jmeter 中运行线程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在CSV数据集配置中使用共享模式"的编辑"这个选项?我在官方网站上找到了描述?

参考文献:

Is there any way to use this option "edit" of "share mode" in CSV Data Set Config? I have found the description in official web site?

apache jmeter component CSV Data Set Config

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.

But I don't understand what is the mean of common id and thread number? How can I use them for the particular thread?

解决方案

For example you have file.csv with the following content:

line1
line2
line3
line4

And 2 Thread Groups with 2 users and 1 Loop executing a Sampler with the following label:

Sampler ${__threadNum} - ${foo}

For different Sharing Mode settings you will get the different behavior i.e.:

  • For sharing mode All Threads:

    Sampler 1 - line1
    Sampler 1 - line2
    Sampler 2 - line3
    Sampler 2 - line4
    

  • For sharing mode Current Thread Group you will get:

    Sampler 1 - line1
    Sampler 1 - line1
    Sampler 2 - line2
    Sampler 2 - line2
    

  • For sharing mode Current Thread you will get:

    Sampler 1 - line1
    Sampler 1 - line1
    Sampler 2 - line1
    Sampler 2 - line1
    

  • For sharing mode ${__threadNum} you will get:

    Sampler 1 - line1
    Sampler 1 - line2
    Sampler 2 - line1
    Sampler 2 - line2
    

Example Test Plan:

References:

这篇关于如何使用 CSV Config Set 的共享模式在 Jmeter 中运行线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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