You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by mburns <m....@digiden.de> on 2008/08/05 11:28:34 UTC

Counter in multiple ThreadGroup iterations

Hello,

when I configure a ThreadGroup for multiple iterations, a Counter  
used to process sub-page parameters inside a Loop is not resetted,  
but starts off with the value of the
previous Threadgroup-cycle (even though I checked the "each user" -  
Option, or use only a single Thread ).
Do I miss something?

Thanks a lot,
Max

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


Re: Counter in multiple ThreadGroup iterations

Posted by mburns <m....@digiden.de>.
Hi Andrey,

sorry for complicating things by omitting the basics, but I really  
meant the most simple case:
a GET-parameter called 'page' which is extracted from the response.

The reason not to use the RegEx Processor / ForEach Loop is that  
there are only very few navigational links presented to user, so I  
concentrated on the last one  (pointing to the last page), to compute  
the number of follow-up requests I would need.

But since the Counter doesn't work for me, I now apply a ForEach  
Controller by declaring variables the way the RegEx Processor would do.

I just wanted to be sure not to miss something before reconfiguring,  
but in the end the changes were done very easily.


Thanks again for the quick advice,
Max



Am 05.08.2008 um 14:13 schrieb Andrey Beznogov:

> Hi,
>
> what do you mean by "sub-pages"? Page frames? Redirects on your http
> request? Or just pages you will request after parsing the response of
> the first request? What is a "page number" - GET parameter in your
> requests? And how exactly do you use the Counter to "fill Get
> parameters"?
>
> Why cannot you just use the e.g. RegExp or XPath Post Processor to
> extract the links for your following request and then loop over those
> in a ForEach Controller?
>
> Regards,
> Andrey
>
> On Tue, Aug 5, 2008 at 3:23 PM, mburns <m....@digiden.de> wrote:
>> Hi, and thanks a lot for the quick response!
>>
>> I'm using it for looping through sub-pages of a given start-url.
>> Due to the design of the sub-page navigation (only very few follow- 
>> up pages
>> are displayed) I don't want to use a for-each construct.
>> Instead I extract the "last" sub-page link via XpathExtractor and  
>> pass the
>> page number after some cleanup in a BSF Postprocessor to a Loop  
>> Controller.
>> Inside the Loop Controller, a Counter is used to fill a Sampler's
>> GET-Parameter.
>>
>> This worked fine, but since I would like to simulate a steady  
>> stream of
>> requests by restarting my ThreadGroup, and the counter won't reset  
>> on each
>> iteration, I will have to find another solution.
>>
>> My next try will be to write url-variables within the BSF  
>> Postprocessor, and
>> pass those to a For-Each Controller.
>> Or is there a better way?
>>
>> Regards,
>> Max
>>
>>
>> Am 05.08.2008 um 12:00 schrieb Andrey Beznogov:
>>
>>> Hi,
>>>
>>> this is working as intended - Counter will live on with the thread 
>>> (s),
>>> and is only set to its starting value once - when it is first
>>> referenced. It will keep its value from loop to loop.
>>>
>>> What are you using it for?
>>>
>>> Regards,
>>> Andrey
>>>
>>>
>>> On Tue, Aug 5, 2008 at 1:28 PM, mburns <m....@digiden.de> wrote:
>>>>
>>>> Hello,
>>>>
>>>> when I configure a ThreadGroup for multiple iterations, a  
>>>> Counter used to
>>>> process sub-page parameters inside a Loop is not resetted, but  
>>>> starts off
>>>> with the value of the
>>>> previous Threadgroup-cycle (even though I checked the "each user" -
>>>> Option,
>>>> or use only a single Thread ).
>>>> Do I miss something?
>>>>
>>>> Thanks a lot,
>>>> Max
>>>>
>>>> ------------------------------------------------------------------- 
>>>> --
>>>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: jmeter-user- 
>>>> help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> diem perdidi
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> 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
>>
>>
>
>
>
> -- 
> diem perdidi
>
> ---------------------------------------------------------------------
> 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: Counter in multiple ThreadGroup iterations

Posted by Andrey Beznogov <an...@googlemail.com>.
Hi,

what do you mean by "sub-pages"? Page frames? Redirects on your http
request? Or just pages you will request after parsing the response of
the first request? What is a "page number" - GET parameter in your
requests? And how exactly do you use the Counter to "fill Get
parameters"?

Why cannot you just use the e.g. RegExp or XPath Post Processor to
extract the links for your following request and then loop over those
in a ForEach Controller?

Regards,
Andrey

On Tue, Aug 5, 2008 at 3:23 PM, mburns <m....@digiden.de> wrote:
> Hi, and thanks a lot for the quick response!
>
> I'm using it for looping through sub-pages of a given start-url.
> Due to the design of the sub-page navigation (only very few follow-up pages
> are displayed) I don't want to use a for-each construct.
> Instead I extract the "last" sub-page link via XpathExtractor and pass the
> page number after some cleanup in a BSF Postprocessor to a Loop Controller.
> Inside the Loop Controller, a Counter is used to fill a Sampler's
> GET-Parameter.
>
> This worked fine, but since I would like to simulate a steady stream of
> requests by restarting my ThreadGroup, and the counter won't reset on each
> iteration, I will have to find another solution.
>
> My next try will be to write url-variables within the BSF Postprocessor, and
> pass those to a For-Each Controller.
> Or is there a better way?
>
> Regards,
> Max
>
>
> Am 05.08.2008 um 12:00 schrieb Andrey Beznogov:
>
>> Hi,
>>
>> this is working as intended - Counter will live on with the thread(s),
>> and is only set to its starting value once - when it is first
>> referenced. It will keep its value from loop to loop.
>>
>> What are you using it for?
>>
>> Regards,
>> Andrey
>>
>>
>> On Tue, Aug 5, 2008 at 1:28 PM, mburns <m....@digiden.de> wrote:
>>>
>>> Hello,
>>>
>>> when I configure a ThreadGroup for multiple iterations, a Counter used to
>>> process sub-page parameters inside a Loop is not resetted, but starts off
>>> with the value of the
>>> previous Threadgroup-cycle (even though I checked the "each user" -
>>> Option,
>>> or use only a single Thread ).
>>> Do I miss something?
>>>
>>> Thanks a lot,
>>> Max
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>>
>>>
>>
>>
>>
>> --
>> diem perdidi
>>
>> ---------------------------------------------------------------------
>> 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
>
>



-- 
diem perdidi

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


Re: Counter in multiple ThreadGroup iterations

Posted by mburns <m....@digiden.de>.
Hi, and thanks a lot for the quick response!

I'm using it for looping through sub-pages of a given start-url.
Due to the design of the sub-page navigation (only very few follow-up  
pages are displayed) I don't want to use a for-each construct.
Instead I extract the "last" sub-page link via XpathExtractor and  
pass the page number after some cleanup in a BSF Postprocessor to a  
Loop Controller.
Inside the Loop Controller, a Counter is used to fill a Sampler's GET- 
Parameter.

This worked fine, but since I would like to simulate a steady stream  
of requests by restarting my ThreadGroup, and the counter won't reset  
on each iteration, I will have to find another solution.

My next try will be to write url-variables within the BSF  
Postprocessor, and pass those to a For-Each Controller.
Or is there a better way?

Regards,
Max


Am 05.08.2008 um 12:00 schrieb Andrey Beznogov:

> Hi,
>
> this is working as intended - Counter will live on with the thread(s),
> and is only set to its starting value once - when it is first
> referenced. It will keep its value from loop to loop.
>
> What are you using it for?
>
> Regards,
> Andrey
>
>
> On Tue, Aug 5, 2008 at 1:28 PM, mburns <m....@digiden.de> wrote:
>> Hello,
>>
>> when I configure a ThreadGroup for multiple iterations, a Counter  
>> used to
>> process sub-page parameters inside a Loop is not resetted, but  
>> starts off
>> with the value of the
>> previous Threadgroup-cycle (even though I checked the "each user"  
>> - Option,
>> or use only a single Thread ).
>> Do I miss something?
>>
>> Thanks a lot,
>> Max
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>
>
>
> -- 
> diem perdidi
>
> ---------------------------------------------------------------------
> 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: Counter in multiple ThreadGroup iterations

Posted by Andrey Beznogov <an...@googlemail.com>.
Hi,

this is working as intended - Counter will live on with the thread(s),
and is only set to its starting value once - when it is first
referenced. It will keep its value from loop to loop.

What are you using it for?

Regards,
Andrey


On Tue, Aug 5, 2008 at 1:28 PM, mburns <m....@digiden.de> wrote:
> Hello,
>
> when I configure a ThreadGroup for multiple iterations, a Counter used to
> process sub-page parameters inside a Loop is not resetted, but starts off
> with the value of the
> previous Threadgroup-cycle (even though I checked the "each user" - Option,
> or use only a single Thread ).
> Do I miss something?
>
> Thanks a lot,
> Max
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>



-- 
diem perdidi

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