testing - Jmeter如何使用CSV Config Set的共享方式运行线程?

标签 testing jmeter

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

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.

但是我不明白common id和thread number是什么意思?我如何将它们用于特定线程?

最佳答案

例如,您有包含以下内容的 file.csv:

line1
line2
line3
line4

和 2 Thread Groups有 2 个用户和 1 个循环执行带有以下标签的采样器:

Sampler ${__threadNum} - ${foo}

对于不同的共享模式设置,您将获得不同的行为,即:

  • 对于共享模式所有线程:

    Sampler 1 - line1
    Sampler 1 - line2
    Sampler 2 - line3
    Sampler 2 - line4
    
  • 对于共享模式当前线程组,您将获得:

    Sampler 1 - line1
    Sampler 1 - line1
    Sampler 2 - line2
    Sampler 2 - line2
    
  • 对于共享模式当前主题,您将获得:

    Sampler 1 - line1
    Sampler 1 - line1
    Sampler 2 - line1
    Sampler 2 - line1
    
  • 对于分享模式${__threadNum}你会得到:

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

示例 Test Plan :

JMeter CSV Data Set Config ThreadNum

引用资料:

关于testing - Jmeter如何使用CSV Config Set的共享方式运行线程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42292760/

相关文章:

php - Joomla 中的 A/B 开发?

java - 无法找到请求的目标 Jmeter 的有效认证路径

gradle - 在build.gradle.kts中传递jmeter简单配置时出错

perl - 如何并行运行 Test::Perl::Critic?

asp.net-mvc - 使用 Entity Framework 实现存储库模式。存储库范围内的问题解决实体

python - 用于预期故障的 Nose 插件

java - 当多个线程并行运行时,如何在 jmeter 中保留线程变量?

java - Host 中和 Host 内部的 Jmeter API 自动化

performance - Tomcat性能调优

android - 我的 friend 如何测试我的 Android 应用程序?