You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by neetu kulshrestha <na...@gmail.com> on 2007/04/25 22:52:10 UTC

Is there any way to count the number of rows in a file

And use it in the loop count for each thread instaed of giving a hard coded
number value. Problem is that the number of values in the inout files may
vary based upon the requirement and I don't want ot go and change the
thred/loop count each time by hand.

Thanks

RE: Is there any way to count the number of rows in a file

Posted by David Schulberg <Da...@objectconsulting.com.au>.
Hi Neetu,
 
If you set the thread group to run forever and set the action to stop your test after a Sampler error then you don't really have to count the rows in your CSV file. Your test will run through all rows and end when it finds EOF.
 
David Schulberg

Object Consulting
email: david.schulberg@objectconsulting.com.au
----------------------------------------------------------------
consulting | development | training | support
our experience makes the difference 

________________________________

From: neetu kulshrestha [mailto:navneekul@gmail.com]
Sent: Thu 26/04/2007 6:52 AM
To: jmeter-user@jakarta.apache.org
Subject: Is there any way to count the number of rows in a file



And use it in the loop count for each thread instaed of giving a hard coded
number value. Problem is that the number of values in the inout files may
vary based upon the requirement and I don't want ot go and change the
thred/loop count each time by hand.

Thanks




Re: Is there any way to count the number of rows in a file

Posted by sebb <se...@gmail.com>.
Or when you create the file, create another file containing the row count.


On 26/04/07, iblavins <ib...@temenos.com> wrote:
> G'day,
>
> Dave's answer is nice and simple.
>
> Another, more complex alternative, is to write a sampler that counts the
> rows in the file and returns the answer as the sampler result.
>
> Then turn the result into a JMeter variable with a regular expression parser
> or similar.
>
> Then use the value of the variable to control the number of loops.
>
> The appeal of this approach is that once you have taken the effort to create
> your own sampler you can use the same basic approach to bring all sorts of
> outside influences (such as the number of rows in a file) to bear on your
> JMeter testing.
>
>
>
>
>
> Ian Blavins
> Contract Performance Engineer
> Temenos
>
>
> -----Original Message-----
> From: neetu kulshrestha [mailto:navneekul@gmail.com]
> Sent: 25 April 2007 21:52
> To: jmeter-user@jakarta.apache.org
> Subject: Is there any way to count the number of rows in a file
>
> And use it in the loop count for each thread instaed of giving a hard coded
> number value. Problem is that the number of values in the inout files may
> vary based upon the requirement and I don't want ot go and change the
> thred/loop count each time by hand.
>
> Thanks
>
>
>
> This email (and any attachments) contains confidential information, and is intended
> only for the named recipient. Distribution or copying of this email by anyone
> other than the named recipient is prohibited. If you are not the named or
> intended recipient, please notify TEMENOS or the sender immediately and
> permanently destroy this email (and any attachments) and all copies of it. No
> member of TEMENOS Group AG or any of its associated or affiliated companies is
> liable for any errors or omissions in the content or transmission of this
> email. Any opinions contained in this email are solely those of the author and,
> unless clearly indicated otherwise in writing, are not endorsed by any member
> of TEMENOS Group AG or any of its associated and affiliated companies.
>
>
> ---------------------------------------------------------------------
> 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


RE: Is there any way to count the number of rows in a file

Posted by iblavins <ib...@temenos.com>.
G'day,

Dave's answer is nice and simple.

Another, more complex alternative, is to write a sampler that counts the
rows in the file and returns the answer as the sampler result.

Then turn the result into a JMeter variable with a regular expression parser
or similar. 

Then use the value of the variable to control the number of loops.

The appeal of this approach is that once you have taken the effort to create
your own sampler you can use the same basic approach to bring all sorts of
outside influences (such as the number of rows in a file) to bear on your
JMeter testing.





Ian Blavins
Contract Performance Engineer
Temenos


-----Original Message-----
From: neetu kulshrestha [mailto:navneekul@gmail.com] 
Sent: 25 April 2007 21:52
To: jmeter-user@jakarta.apache.org
Subject: Is there any way to count the number of rows in a file

And use it in the loop count for each thread instaed of giving a hard coded
number value. Problem is that the number of values in the inout files may
vary based upon the requirement and I don't want ot go and change the
thred/loop count each time by hand.

Thanks



This email (and any attachments) contains confidential information, and is intended 
only for the named recipient. Distribution or copying of this email by anyone 
other than the named recipient is prohibited. If you are not the named or 
intended recipient, please notify TEMENOS or the sender immediately and 
permanently destroy this email (and any attachments) and all copies of it. No 
member of TEMENOS Group AG or any of its associated or affiliated companies is 
liable for any errors or omissions in the content or transmission of this 
email. Any opinions contained in this email are solely those of the author and, 
unless clearly indicated otherwise in writing, are not endorsed by any member 
of TEMENOS Group AG or any of its associated and affiliated companies. 


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