简体   繁体   English

Jmeter分布式负载测试中csv文件的自动分布式读取?

[英]Automatic distributed reading of csv file in Jmeter distributed load testing?

My scenario is while doing distributed load testing through jmeter i want csv file should read in auto distributed manner.我的场景是通过 jmeter 进行分布式负载测试时,我希望 csv 文件应该以自动分布式方式读取。 example if i have 100 users entry in csv data set config file and number of slave server is 10. so in normal scenario i have to keep csv file entry in arranged manner like例如,如果我在csv 数据集配置文件中有 100 个用户条目,并且从服务器的数量为 10。所以在正常情况下,我必须以排列方式保留 csv 文件条目,例如

user1- to 10 at slave-1
user-11to20 at slave-2
.
.
.
user-91 to 100 at slave 3

so i want same csv file have entry of all 100 users should be placed at all slave and jmeter automatically read entry from these files and distribute it.所以我想要相同的 csv 文件有所有 100 个用户的条目应该放置在所有从属和 jmeter 自动从这些文件中读取条目并分发它。

JMeter doesn't provide such functionality out of the box so the only option I can think of is reading required X lines with the given offset depending on the slave hostname or IP address somewhere in setUp Thread Group using JSR223 Sampler and Groovy language and writing this range of lines into a new file which will be used in the CSV Data Set Config. JMeter doesn't provide such functionality out of the box so the only option I can think of is reading required X lines with the given offset depending on the slave hostname or IP address somewhere in setUp Thread Group using JSR223 Sampler and Groovy language and writing this将一系列行放入一个新文件中,该文件将在 CSV 数据集配置中使用。

Another possible solution would be going for HTTP Simple Table Server , it's READ endpoint allows removing the value after reading it so you will have unique data for all slaves.另一种可能的解决方案是HTTP Simple Table Server ,它的READ端点允许在读取后删除该值,因此您将拥有所有从站的唯一数据。

You cannot do that at the moment but if you want a configuration in which each thread uses unique data even across slave machines, then you should use different Test Data files on different slave machine.目前你不能这样做,但如果你想要一个配置,其中每个线程甚至跨从机使用唯一数据,那么你应该在不同的从机上使用不同的测试数据文件。

You have to place this Test Data file on each slave machine (with same location as on master).您必须将此测试数据文件放置在每台从机上(与主机上的位置相同)。 JMeter will use Test Data from the slave machine and not from the Master, so placing different data set on different machine will ensure uniqueness. JMeter 将使用来自从机而不是来自主机的测试数据,因此将不同的数据集放在不同的机器上将确保唯一性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM