如何使用CSV数据配置文件中的唯一数据循环每个线程 [英] How to loop each thread with unique data from CSV Data Config file

查看:373
本文介绍了如何使用CSV数据配置文件中的唯一数据循环每个线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有25个用户的CSV数据配置文件.当我创建一个由25个用户组成的线程组时,我希望每个线程从CSV数据配置中选择一行并在其中循环.

I have CSV data config file with 25 users. When I create a Thread group of 25 users I want each thread to pick one line from CSV Data config and loop around.

所以

User1 picks userA
Users2 pick userB.......userN pick user(SomeX)

设置为保持活动状态后,我想在同一套接字上重用连接和同一组数据.

As I set keep alive so I want to reuse the connection and same set of data on the same socket.

My CSV file Recycle on EOF False
Stop Thread on EOF True
Sharing Mode : Current Thread.

但是我观察到的是Thread 1-1 User1 picks UserA ( iteration 1) Thread 1-1 User 1 picks User B iteration 2

我期望的是

Thread 1-1 User1 picks UserA ( iteration 1)
Thread 1-1 User 1 picks User A ( iteration 2 )

推荐答案

根据您的描述,每个JMeter线程将独立且分别读取CSV文件,即:

According to your description each JMeter thread will read CSV file independently and separately, i.e.:

  • Thread 1-1将处理所有25个CSV条目定义的迭代次数
  • Thread 1-2将处理所有25个CSV条目定义的迭代次数
  • Thread 1-1 will process all 25 CSV entries defined number of iterations
  • Thread 1-2 will process all 25 CSV entries defined number of iterations
  • etc.

鉴于CSV文件中的行数与虚拟用户数相等,最好将共享模式"设置为All threads,以便每个虚拟用户都可以从CSV文件中选择自己的行.

Given you have equal number of lines in CSV file and virtual users it might be better idea setting "Sharing mode" to All threads so each virtual user could pick its own line from the CSV file.

更多信息:

  • CSV Data Set Config
  • CSV Data Set Config in Sharing Mode - Made Easy

这篇关于如何使用CSV数据配置文件中的唯一数据循环每个线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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