Vishal Goyan
Vishal Goyan

Reputation: 11

How to pick unique value from CSV file in Jmeter distributed testing

when we run JMX file in multiple remote hosts, we need to copy all the parameter files to all the hosts, in this case there will be no uniqueness as parameter file will be available in all the hosts and will be picked up locally.

I need to use unique each iteration same as Loadrunner functionality with Jmeter distributed testing.

Upvotes: 1

Views: 1046

Answers (3)

Dmitri T
Dmitri T

Reputation: 168002

Consider using HTTP Simple Table Server.

It can be used on one host to set up a small HTTP server serving the CSV file of your choice:

enter image description here

then you can issue a READ command and set KEEP parameter to FALSE like:

http://hostname:port/sts/READ?READ_MODE=RANDOM&KEEP=FALSE&FILENAME=your_file.csv

this way you can guarantee the "uniqueness" of the test data as it will be read only once.

You can install HTTP Simple Table Server using JMeter Plugins Manager:

enter image description here

Upvotes: 1

James Pulley
James Pulley

Reputation: 5682

Feed your parameters from an external source, a queue. Preload your queue values before the test. As each value is "popped" once, this guarantees uniqueness across load generators, different script definitions, even where you have multiple tools driving load.

You might consider Amazon AWS Simple Queue Service (SQS). The pricing is ridiculously low for the amount of data you will need for your performance tests, plus the interface is HTTP for pushing and popping values, which makes for an excellent complement to an existing HTTP script.

Upvotes: 0

Yugal
Yugal

Reputation: 424

Split your CSV in to number of Load generator hosts

$ wc -l "youroriginalcsv.csv" /* this will return number of total rows in csv*/

$ split -l "count of above query"/"number of hosts" "youroriginalcsv.csv" /* this will split CSV with file name as xaa, xab ... */

Transfer each unique CSV to all available hosts

$ scp xaa host1_user@host1_ip:/csvpath/csvfile.csv

$ scp xab host2_user@host2_ip:/csvpath/csvfile.csv

.

$ scp xaz hostN_user@hostN_ip:/csvpath/csvfile.csv

/* use this path in your test script */

Cheers!

Upvotes: 0

Related Questions