Hi
its correct in the sense that is what the code does - The internal thread
numbers are started from 0 and thats what returned from JMeterContext
However the display of thread name adds a '1' so those numbers are one
based. The function __threadNum reads the number from the threadName so it
is 1 based.
It *should* probably be changed to be consistent - However you can either
use the function or add 1 if you want numbers to be 1 based,

regards
deepak



On Mon, Jul 25, 2016 at 6:23 AM, ZK <[email protected]> wrote:

> Hi,
> for debugging purposes, I would like to get the current thread number using
> a beanshell post processor.
>
> the code I am using is:
> print("Thread Number = "+ctx.getThreadNum());
>
> However, when i am running the test with 1 thread, the above code outputs:
> Thread Number = 0
>
> when running with 3 threads the output is:
> Thread Number = 0
> Thread Number = 1
> Thread Number = 2
>
> This isn't a problem for me, but I would like to clarify if this is the
> correct output, as I would expect to see:
> Thread Number = 1
> Thread Number = 2
> Thread Number = 3
>
>
> ZK
>
>
>
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Getting-the-thread-number-from-a-Beanshell-post-processor-tp5724544.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to