修复基于记录数的线程计数

huangapple go评论54阅读模式
英文:

Fix thread counts based on records count

问题

我有一个需求,需要在Oracle数据库上运行查询并提取帐户号码,线程计数的数量将基于从数据库返回的记录数固定。

我可以使用JDBC提取帐户号码并写入CSV。但是我无法破解基于记录数固定线程计数的逻辑。

需要您在这种情况下提供线程计数的建议。

提前感谢。

英文:

I have a requirement to run a query on Oracle DB and fetch account numbers, the number of thread counts will be fixed based on number of records returned from DB.

I am able to fetch account numbers by using JDBC and write in a csv. But i couldn't crack the logic of fixing the thread count based on number of records.

Need your inputs on this scenario to fix the thread count.

Thanks in advance..

答案1

得分: 1

你可以使用以下方法:

  1. 使用设置线程组来从数据库中提取记录并将其存储到文件中。
  2. 在“正常”线程组中使用__CSVRead()__StringFromFile()函数来从CSV文件中读取帐户的数量。线程组将启动与文件中的线程数相同的线程。
英文:

You can use

  1. setUp Thread Group to fetch the records from the database and storing it into the file
  2. __CSVRead() or __StringFromFile() function in the "normal" Thread Group to read the number of accounts from the CSV file. The Thread Group will kick off as many threads as it will be in the file.

huangapple
  • 本文由 发表于 2023年3月12日 12:08:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/75711000.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定