You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by durgs <du...@gmail.com> on 2006/05/17 19:15:00 UTC

csv data not coming into loop correctly

Hi,
I have a problem in reading the cdv file.
I have a script like
TestPlan
|-> Thread
        |-> Http...
        | -> Loop 
            | -> csv data config - to read data
            | -> http request...

what happens is i have put no of threads = 2.
for user1, loop count = 2,loop shld run 2 times
for user2, loop count =3, loop should run 3 times

i have csv data as run1, run2, run3
what i want is user1 with loop=2 to have values - run1 and run2
i want user2 with loop=3 to have values - run1, run2, run3

instead wht is happening is - 
user1 takes run1 - first loop
user2 takes run2 - first loop
user1 takes run3 - second loop
user2 takes run1 again - second loop
user2 takes run2 again - third loop

pls help me on this.... i need values to be read as below..
user1 takes run1 - first loop
user2 takes run1 - first loop
user1 takes run2 - second loop
user2 takes run2 again - second loop
user2 takes run3 again - third loop

any suggestions..


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


Re: csv data not coming into loop correctly

Posted by sebb <se...@gmail.com>.
On 17/05/06, durgs <du...@gmail.com> wrote:
> sebb <sebbaz <at> gmail.com> writes:
>
> >
> > Use separate files for each user - in general there is no way of
> > knowing which thread will next read the file.
> >
> > Just add the thread number to the file name, and copy the file as many
> > times as needed.
> >
> > Alternatively, if you really want the actual values RUN1, RUN2, RUN3,
> > the add a per-thread counter, C, and use the value RUN{C}.
> >
> hi sebb,
> but y is this looping different. i cant use the run{c} bcoz, above eg is just

Because the Counter can maintain separate counters for each thread.

> for reference.
> what actually i need is - single thread to be run with 2 users simultaneously.

Not possible - a thread represents a user.

> a loop is there inside which im reading a csv file which has 3 datavalues
> user1 logs in, enters the loop, reads value1 frm csv
> user2 logs in, enters the loop, reads values2 frm csv - but y is it reading
> value2. its a diffrnt thread and a diffrnt loop, counter shld be zero rite here.

No, the CSV Data Set, and CSVRead() and StringFromFile() functions are
designed to share the file between all threads. This is so that you
can set up a file with a set of unique data items, and ensure that
each thread(user) works with its own value.

> the user2 is supposed to read value1 frm csv file.
> i need user1 to read value1, value2, value3
> i need user2 to read value1, value2, value3
> but whats happening is -
> user1 reads value1, value3,valu5
> user2 reads value2,valu4,value6
> since this is a small thread with just 2 users, its fine
> but i need to load test on 100 users
> so it wud fail
> pls assist

Do the users really have to run with the same values in each thread?

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


Re: csv data not coming into loop correctly

Posted by durgs <du...@gmail.com>.
sebb <sebbaz <at> gmail.com> writes:

>  
> Use separate files for each user - in general there is no way of
> knowing which thread will next read the file.
> 
> Just add the thread number to the file name, and copy the file as many
> times as needed.
> 
> Alternatively, if you really want the actual values RUN1, RUN2, RUN3,
> the add a per-thread counter, C, and use the value RUN{C}.
> 
hi sebb,
but y is this looping different. i cant use the run{c} bcoz, above eg is just
for reference.
what actually i need is - single thread to be run with 2 users simultaneously.
a loop is there inside which im reading a csv file which has 3 datavalues
user1 logs in, enters the loop, reads value1 frm csv 
user2 logs in, enters the loop, reads values2 frm csv - but y is it reading
value2. its a diffrnt thread and a diffrnt loop, counter shld be zero rite here.
the user2 is supposed to read value1 frm csv file.
i need user1 to read value1, value2, value3
i need user2 to read value1, value2, value3
but whats happening is - 
user1 reads value1, value3,valu5
user2 reads value2,valu4,value6
since this is a small thread with just 2 users, its fine
but i need to load test on 100 users
so it wud fail
pls assist


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


Re: csv data not coming into loop correctly

Posted by sebb <se...@gmail.com>.
On 17/05/06, durgs <du...@gmail.com> wrote:
> Hi,
> I have a problem in reading the cdv file.
> I have a script like
> TestPlan
> |-> Thread
>         |-> Http...
>         | -> Loop
>             | -> csv data config - to read data
>             | -> http request...
>
> what happens is i have put no of threads = 2.
> for user1, loop count = 2,loop shld run 2 times
> for user2, loop count =3, loop should run 3 times
>
> i have csv data as run1, run2, run3
> what i want is user1 with loop=2 to have values - run1 and run2
> i want user2 with loop=3 to have values - run1, run2, run3
>
> instead wht is happening is -
> user1 takes run1 - first loop
> user2 takes run2 - first loop
> user1 takes run3 - second loop
> user2 takes run1 again - second loop
> user2 takes run2 again - third loop
>
> pls help me on this.... i need values to be read as below..
> user1 takes run1 - first loop
> user2 takes run1 - first loop
> user1 takes run2 - second loop
> user2 takes run2 again - second loop
> user2 takes run3 again - third loop
>
> any suggestions..

Use separate files for each user - in general there is no way of
knowing which thread will next read the file.

Just add the thread number to the file name, and copy the file as many
times as needed.

Alternatively, if you really want the actual values RUN1, RUN2, RUN3,
the add a per-thread counter, C, and use the value RUN{C}.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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