You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by byungsookim <bs...@yahoo.com> on 2008/11/20 16:27:39 UTC

How to maintain the active number of threads during execution?

Hello,

In Jmeter, Thread group element has three options when a sampler fails:
Continue, Stop Thread, Stop Test. 

If I choose "Continue", it will go through all the steps even after it
encounters a failure - this generates unnecessary error messages since my
scenario works only in series. However, it maintains the number of threads
throughout the whole test

If I choose "stop thread", the thread stops when it encounters a failure so
it does not generate junk error messages. However, the number of active
thread goes down every time this occurs.

I need a way to do this between these options: When a failure occurs in a
thread, it stops the rest of the scenarios and it restarts from the
beginning. In this way, it will maintain the number of threads and it does
not cause any junk error messages in the system. Anybody knows how I can
achieve this?

Thanks in advance.

Byungsoo Kim
-- 
View this message in context: http://www.nabble.com/How-to-maintain-the-active-number-of-threads-during-execution--tp20603516p20603516.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Re: How to maintain the active number of threads during execution?

Posted by sebb <se...@gmail.com>.
On 21/11/2008, byungsookim <bs...@yahoo.com> wrote:
>
>  Thanks!!
>
>  I was afraid that what you said was the solution to it. I am assuming
>  JMeterThread.last_sample_ok is supposed to get reset in the beginning of
>  each loop for a thread.

No, the variable is set to true or false after every sample.
It is initially true.

>  However, in my past execution, I have seen the case
>  in which the solution failed to maintain the number of thread sometimes. I
>  tried to set the value of the variable to "true"  by adding Simple Config
>  Element at the end - I do not think that it worked though since Debug
>  Sampler says "false".
>
>  Do you know how to force the value of the JMeterThread.last_sample_ok value
>  to be true?

Should not be necessary, but if you do have to set it one way is to
add a Java Request sampler with the appropriate status, i.e. OK or
something else.

>  Thanks again.
>
>  Byungsoo Kim
>
>
>  sebb-2-2 wrote:
>  >
>  > On 20/11/2008, byungsookim <bs...@yahoo.com> wrote:
>  >>
>  >>  Hello,
>  >>
>  >>  In Jmeter, Thread group element has three options when a sampler fails:
>  >>  Continue, Stop Thread, Stop Test.
>  >>
>  >>  If I choose "Continue", it will go through all the steps even after it
>  >>  encounters a failure - this generates unnecessary error messages since
>  >> my
>  >>  scenario works only in series. However, it maintains the number of
>  >> threads
>  >>  throughout the whole test
>  >>
>  >>  If I choose "stop thread", the thread stops when it encounters a failure
>  >> so
>  >>  it does not generate junk error messages. However, the number of active
>  >>  thread goes down every time this occurs.
>  >>
>  >>  I need a way to do this between these options: When a failure occurs in
>  >> a
>  >>  thread, it stops the rest of the scenarios and it restarts from the
>  >>  beginning. In this way, it will maintain the number of threads and it
>  >> does
>  >>  not cause any junk error messages in the system. Anybody knows how I can
>  >>  achieve this?
>  >>
>  >
>  > Only by using the If Controller to wrap each sampler, e.g.
>  >
>  > Sampler 1
>  > IF condition: ${JMeterThread.last_sample_ok}
>  > + Sampler 2
>  > IF condition: ${JMeterThread.last_sample_ok}
>  > + Sampler 3
>  >
>  > etc.
>  >
>  >>  Thanks in advance.
>  >>
>  >>  Byungsoo Kim
>  >>
>  >> --
>  >>  View this message in context:
>  >> http://www.nabble.com/How-to-maintain-the-active-number-of-threads-during-execution--tp20603516p20603516.html
>  >>  Sent from the JMeter - User mailing list archive at Nabble.com.
>  >>
>  >>
>  >>  ---------------------------------------------------------------------
>  >>  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
>  >
>  >
>  >
>
>
> --
>  View this message in context: http://www.nabble.com/How-to-maintain-the-active-number-of-threads-during-execution--tp20603516p20620814.html
>
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  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: How to maintain the active number of threads during execution?

Posted by byungsookim <bs...@yahoo.com>.
Thanks!!

I was afraid that what you said was the solution to it. I am assuming
JMeterThread.last_sample_ok is supposed to get reset in the beginning of
each loop for a thread. However, in my past execution, I have seen the case
in which the solution failed to maintain the number of thread sometimes. I
tried to set the value of the variable to "true"  by adding Simple Config
Element at the end - I do not think that it worked though since Debug
Sampler says "false".

Do you know how to force the value of the JMeterThread.last_sample_ok value
to be true?

Thanks again.

Byungsoo Kim

sebb-2-2 wrote:
> 
> On 20/11/2008, byungsookim <bs...@yahoo.com> wrote:
>>
>>  Hello,
>>
>>  In Jmeter, Thread group element has three options when a sampler fails:
>>  Continue, Stop Thread, Stop Test.
>>
>>  If I choose "Continue", it will go through all the steps even after it
>>  encounters a failure - this generates unnecessary error messages since
>> my
>>  scenario works only in series. However, it maintains the number of
>> threads
>>  throughout the whole test
>>
>>  If I choose "stop thread", the thread stops when it encounters a failure
>> so
>>  it does not generate junk error messages. However, the number of active
>>  thread goes down every time this occurs.
>>
>>  I need a way to do this between these options: When a failure occurs in
>> a
>>  thread, it stops the rest of the scenarios and it restarts from the
>>  beginning. In this way, it will maintain the number of threads and it
>> does
>>  not cause any junk error messages in the system. Anybody knows how I can
>>  achieve this?
>>
> 
> Only by using the If Controller to wrap each sampler, e.g.
> 
> Sampler 1
> IF condition: ${JMeterThread.last_sample_ok}
> + Sampler 2
> IF condition: ${JMeterThread.last_sample_ok}
> + Sampler 3
> 
> etc.
> 
>>  Thanks in advance.
>>
>>  Byungsoo Kim
>>
>> --
>>  View this message in context:
>> http://www.nabble.com/How-to-maintain-the-active-number-of-threads-during-execution--tp20603516p20603516.html
>>  Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>>
>>  ---------------------------------------------------------------------
>>  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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-maintain-the-active-number-of-threads-during-execution--tp20603516p20620814.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Re: How to maintain the active number of threads during execution?

Posted by sebb <se...@gmail.com>.
On 20/11/2008, byungsookim <bs...@yahoo.com> wrote:
>
>  Hello,
>
>  In Jmeter, Thread group element has three options when a sampler fails:
>  Continue, Stop Thread, Stop Test.
>
>  If I choose "Continue", it will go through all the steps even after it
>  encounters a failure - this generates unnecessary error messages since my
>  scenario works only in series. However, it maintains the number of threads
>  throughout the whole test
>
>  If I choose "stop thread", the thread stops when it encounters a failure so
>  it does not generate junk error messages. However, the number of active
>  thread goes down every time this occurs.
>
>  I need a way to do this between these options: When a failure occurs in a
>  thread, it stops the rest of the scenarios and it restarts from the
>  beginning. In this way, it will maintain the number of threads and it does
>  not cause any junk error messages in the system. Anybody knows how I can
>  achieve this?
>

Only by using the If Controller to wrap each sampler, e.g.

Sampler 1
IF condition: ${JMeterThread.last_sample_ok}
+ Sampler 2
IF condition: ${JMeterThread.last_sample_ok}
+ Sampler 3

etc.

>  Thanks in advance.
>
>  Byungsoo Kim
>
> --
>  View this message in context: http://www.nabble.com/How-to-maintain-the-active-number-of-threads-during-execution--tp20603516p20603516.html
>  Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  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