英文:
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
你可以使用以下方法:
- 使用设置线程组来从数据库中提取记录并将其存储到文件中。
- 在“正常”线程组中使用__CSVRead()或__StringFromFile()函数来从CSV文件中读取帐户的数量。线程组将启动与文件中的线程数相同的线程。
英文:
You can use
- setUp Thread Group to fetch the records from the database and storing it into the file
- __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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论