You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "shigella Gazeta.pl" <sh...@gazeta.pl> on 2008/10/10 19:12:52 UTC

Fwd: Multi transactional request with data from CSV

Hello,
I've got a task to prepare multi transactional and multi thread performance
test.Data should be get from CSV file.
Each request is the same, but the names should increase. For next loop and
thread data should change.

I'll try to explain it on the sample. I would like to get results like
below:

Thread 1-1
  Request:Name 1, Surname1
  Request:Name 2, Surname2
  Request:Name 3, Surname3
.
.
.
  Request:Name 100, Surname100

Next sample will be

Thread 2-1
  Request:Name 101, Surname101
  Request:Name 102, Surname102
  Request:Name 103, Surname103
.
.
.
  Request:Name 200, Surname200

And Next:

Thread 2-2
  Request:Name 201, Surname201
  Request:Name 202, Surname202
  Request:Name 203, Surname203
.
.
.
  Request:Name 300, Surname300

etc.
CSV from file uses same Surname and Name in each request for one sample.
I thought about using __CSVRead function, but defining variables even for 10
requests sounds awful.
Defining it for 100 requests (I use more than Name and Surname variables) is
hard to imagine, and my leaders said something about 500 requests in one
sample.
Is another way to get different data in each request?
Thanks
Shigella

Re: Multi transactional request with data from CSV

Posted by sebb <se...@gmail.com>.
On 10/10/2008, shigella Gazeta.pl <sh...@gazeta.pl> wrote:
> Hello,
>  I've got a task to prepare multi transactional and multi thread performance
>  test.Data should be get from CSV file.
>  Each request is the same, but the names should increase. For next loop and
>  thread data should change.
>
>  I'll try to explain it on the sample. I would like to get results like
>  below:
>
>  Thread 1-1
>   Request:Name 1, Surname1
>   Request:Name 2, Surname2
>   Request:Name 3, Surname3
>  .
>  .
>  .
>   Request:Name 100, Surname100
>
>  Next sample will be
>
>  Thread 2-1
>   Request:Name 101, Surname101
>   Request:Name 102, Surname102
>   Request:Name 103, Surname103
>  .
>  .
>  .
>   Request:Name 200, Surname200
>
>  And Next:
>
>  Thread 2-2
>   Request:Name 201, Surname201
>   Request:Name 202, Surname202
>   Request:Name 203, Surname203
>  .
>  .
>  .
>   Request:Name 300, Surname300
>
>  etc.
>  CSV from file uses same Surname and Name in each request for one sample.
>  I thought about using __CSVRead function, but defining variables even for 10
>  requests sounds awful.

You only need to define two variables (Name and Surname) and then loop
through the CSV file, which should have two columns (Name and
Surname).

However CSVRead is not suitable for large files.

CSV Dataset is better.

>  Defining it for 100 requests (I use more than Name and Surname variables) is
>  hard to imagine, and my leaders said something about 500 requests in one
>  sample.
>  Is another way to get different data in each request?

Of course.

Create a CSV file containing the Name,Surname pairs, one per line.

The test plan can look like:

Thread Group loops=100, threads=n
+ CVS Dataset NAME,SURNAME
+ Sampler

Each thread will process 100 samples, and each one will use the next
line from the CSV file. The order will depend on how quickly each
thread runs, so the samples won't necessarily be consecutive in each
thread.

If you want to ensure that each thread uses a separate set of values,
then you will need to create a different file for each thread, e.g.
csv1.dat, csv2.dat etc. and then use csv${__threadNum}.dat as the
filename and use sharing mode=current thread.

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#CSV_Data_Set_Config

Try experimenting with a small file and a few loops/threads.

>  Thanks
>
> Shigella
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org