On 08/05/2008, Steve Kapinos <[EMAIL PROTECTED]> wrote:
> So you'll need the work-round below anyway (which does work for me).
>
>  >  However you can use the following instead:
>  >
>  >  + Java Request (set Status != OK)
>  >  + + Synch timer
>  >  + + Result Status Action Handler (Stop Test)
>
>
> I made a simple test plan to test how it would work like this
>
>  Threadgroup (users = 10)
>  + http request
>  + java request
>  + + synch timer (5)
>  + + result status action (value for status set to '!OK')
>  + agg report
>
>  To ensure it would stop the test at 5 samples instead of 10.. Which it
>  does, but has a bit of a side effect that it then logs 5 errors skewing
>  results a bit or requiring more log processing (which I have not gotten
>  to work out yet).
>
>  Testing where the synch timer and user count are equal - it still shows
>  a failure on the java request.  So I always get 1 failure per thread.

Yes.

>  Any other way I can do this without triggering a failure on a request to
>  make it stop?

Wait for the next release - I've fixed the NPE ...

Or the change is in the current nightly build (r654515 or later).

> Maybe setting/incrementing a property from my testing
>  thread which is read each loop by the 'monitoring' thread which once it
>  reaches a value it uses TestAction to stop that thread?  The testing
>  threadgroup will stop on its own when its finished its cycles..
>  Basically using a property as a counter incremented per testingthread,
>  then using that counter as the
>
>  Something like
>
>  Testing Threadgroup (users = 100)
>  + work
>  + work
>  + testaction and in comment use ${__setProperty($stopcounter,
>  ${__jexl(${stopcounter}+1)}

That may not be thread-safe - updates may be lost if two threads run
the test action at about the same time.

The Jexl execute() method is synchronized, so if there is only one
instance of the function call, you could perhaps do it all in Jexl.

>  Monitor Threadgroup (loop forever)
>  + While Controller (with condition ${__jexl(${stopcounter}<= 100))
>  + + sampler
>  + Test Action (stop thread)
>
>
>  I think that should work without logging any failures since the while
>  controller check is the only conditional checking.
>

Actually, I think there's a simpler solution.

Instead of counting threads, use the JMeter counter:

JMeterContextService.getNumberOfThreads()

If this is 1, then there is only 1 thread active.

For example, in BeanShell:

${__BeanShell(org.apache.jmeter.threads.JMeterContextService.getNumberOfThreads()==1)}

I'm not sure that Jexl can access static methods.

Or, use the Sync Timer to run a sampler that just sets a single
property, e.g. endTest=true.

>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to