You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by alexs <al...@gmail.com> on 2014/01/28 12:52:18 UTC

Thread group Loop count: How can I tell in which round am I?

Ia there a global variable that holds this Info ?

Thanks



--
View this message in context: http://jmeter.512774.n5.nabble.com/Thread-group-Loop-count-How-can-I-tell-in-which-round-am-I-tp5719210.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Thread group Loop count: How can I tell in which round am I?

Posted by sebb <se...@gmail.com>.
Good idea, but I suspect it might be rather tricky to implement.
I don't think a Function has access to the controller variables.

However, it could take a parameter of the name of the Controller -
that would solve the nested loop issue, assuming that the controller
loop counter can be found somehow.

JMeterContext could perhaps be extended to hold a pointer to the
controller package. That should be cheaper than storing the loop
counter for each loop.

On 30 January 2014 14:46, John_schulz <jo...@aol.com> wrote:
> How about a function call along the same lines as threadNum. LoopCount maybe? That way there is no need to set a variable on each iteration of the thread loop.
>
> Sent from my iPad
>
>> On Jan 30, 2014, at 7:30 AM, sebb <se...@gmail.com> wrote:
>>
>> Not sure how easy it will be but it would be useful sometimes.
>> However, it will add extra processing to every test unless some way
>> can be found to make it optional
>>
>> If the variable is named after the loop controller then it would be up
>> to the user to ensure that names are unique.
>>
>>> On 30 January 2014 12:21, Philippe Mouawad <ph...@gmail.com> wrote:
>>> Hello,
>>>
>>> What about adding a new feature to expose a variable containing this loop
>>> number ?
>>>
>>> The issue would be to ensure in nested loop name uniticity.
>>>
>>> Regards
>>>
>>>
>>>
>>>> On Thu, Jan 30, 2014 at 12:27 PM, sebb <se...@gmail.com> wrote:
>>>>
>>>>> On 30 January 2014 08:57, Adrian Speteanu <as...@gmail.com> wrote:
>>>>> Not just like that, there is a method exposed:
>>>> http://people.apache.org/~mkostrze/jmeter-docs/docs/api/org/apache/jmeter/functions/ThreadNumber.html
>>>>>
>>>>> In the script, use this function (try the function helper for details):
>>>>
>>>> Or see http://jmeter.apache.org/usermanual/functions.html#__threadNum
>>>>
>>>>> ${__threadNum}
>>>>
>>>> That is the thread number, which does not vary.
>>>> It is not the loop count within a thread.
>>>>
>>>> I think the only method to get the loop cound is to add a counter as
>>>> already suggested.
>>>
>>>>> The thread number is also exposed in test output (the jtl), several
>>>>> listeners (View Results Table - don't use during high load because of its
>>>>> high memory consumption). The information is displayed as (example:)
>>>> tn="Thread
>>>>> Group 1-1" (first digit group represents the thread group number, second
>>>>> digit group represents the thread number inside that particular thread
>>>>> group).
>>>>>
>>>>> --Adrian S
>>>>>
>>>>>
>>>>>> On Wed, Jan 29, 2014 at 10:40 AM, ZK <st...@gmail.com> wrote:
>>>>>>
>>>>>> Hi,
>>>>>> just add a  counter
>>>>>> <http://jmeter.apache.org/usermanual/component_reference.html#Counter>
>>>> to
>>>>>> your thread group and reference the variable of that counter to find the
>>>>>> loop count
>>>>>>
>>>>>>
>>>>>> ZK
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>> http://jmeter.512774.n5.nabble.com/Thread-group-Loop-count-How-can-I-tell-in-which-round-am-I-tp5719210p5719218.html
>>>>>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>
>>>
>>> --
>>> Cordialement.
>>> Philippe Mouawad.

Re: Thread group Loop count: How can I tell in which round am I?

Posted by John_schulz <jo...@aol.com>.
How about a function call along the same lines as threadNum. LoopCount maybe? That way there is no need to set a variable on each iteration of the thread loop. 

Sent from my iPad

> On Jan 30, 2014, at 7:30 AM, sebb <se...@gmail.com> wrote:
> 
> Not sure how easy it will be but it would be useful sometimes.
> However, it will add extra processing to every test unless some way
> can be found to make it optional
> 
> If the variable is named after the loop controller then it would be up
> to the user to ensure that names are unique.
> 
>> On 30 January 2014 12:21, Philippe Mouawad <ph...@gmail.com> wrote:
>> Hello,
>> 
>> What about adding a new feature to expose a variable containing this loop
>> number ?
>> 
>> The issue would be to ensure in nested loop name uniticity.
>> 
>> Regards
>> 
>> 
>> 
>>> On Thu, Jan 30, 2014 at 12:27 PM, sebb <se...@gmail.com> wrote:
>>> 
>>>> On 30 January 2014 08:57, Adrian Speteanu <as...@gmail.com> wrote:
>>>> Not just like that, there is a method exposed:
>>> http://people.apache.org/~mkostrze/jmeter-docs/docs/api/org/apache/jmeter/functions/ThreadNumber.html
>>>> 
>>>> In the script, use this function (try the function helper for details):
>>> 
>>> Or see http://jmeter.apache.org/usermanual/functions.html#__threadNum
>>> 
>>>> ${__threadNum}
>>> 
>>> That is the thread number, which does not vary.
>>> It is not the loop count within a thread.
>>> 
>>> I think the only method to get the loop cound is to add a counter as
>>> already suggested.
>> 
>>>> The thread number is also exposed in test output (the jtl), several
>>>> listeners (View Results Table - don't use during high load because of its
>>>> high memory consumption). The information is displayed as (example:)
>>> tn="Thread
>>>> Group 1-1" (first digit group represents the thread group number, second
>>>> digit group represents the thread number inside that particular thread
>>>> group).
>>>> 
>>>> --Adrian S
>>>> 
>>>> 
>>>>> On Wed, Jan 29, 2014 at 10:40 AM, ZK <st...@gmail.com> wrote:
>>>>> 
>>>>> Hi,
>>>>> just add a  counter
>>>>> <http://jmeter.apache.org/usermanual/component_reference.html#Counter>
>>> to
>>>>> your thread group and reference the variable of that counter to find the
>>>>> loop count
>>>>> 
>>>>> 
>>>>> ZK
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> View this message in context:
>>> http://jmeter.512774.n5.nabble.com/Thread-group-Loop-count-How-can-I-tell-in-which-round-am-I-tp5719210p5719218.html
>>>>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>> For additional commands, e-mail: user-help@jmeter.apache.org
>> 
>> 
>> --
>> Cordialement.
>> Philippe Mouawad.

Re: Thread group Loop count: How can I tell in which round am I?

Posted by sebb <se...@gmail.com>.
Not sure how easy it will be but it would be useful sometimes.
However, it will add extra processing to every test unless some way
can be found to make it optional

If the variable is named after the loop controller then it would be up
to the user to ensure that names are unique.

On 30 January 2014 12:21, Philippe Mouawad <ph...@gmail.com> wrote:
> Hello,
>
> What about adding a new feature to expose a variable containing this loop
> number ?
>
> The issue would be to ensure in nested loop name uniticity.
>
> Regards
>
>
>
> On Thu, Jan 30, 2014 at 12:27 PM, sebb <se...@gmail.com> wrote:
>
>> On 30 January 2014 08:57, Adrian Speteanu <as...@gmail.com> wrote:
>> > Not just like that, there is a method exposed:
>> >
>> http://people.apache.org/~mkostrze/jmeter-docs/docs/api/org/apache/jmeter/functions/ThreadNumber.html
>> >
>> > In the script, use this function (try the function helper for details):
>>
>> Or see http://jmeter.apache.org/usermanual/functions.html#__threadNum
>>
>> > ${__threadNum}
>>
>> That is the thread number, which does not vary.
>> It is not the loop count within a thread.
>>
>> I think the only method to get the loop cound is to add a counter as
>> already suggested.
>>
>>
>
>> > The thread number is also exposed in test output (the jtl), several
>> > listeners (View Results Table - don't use during high load because of its
>> > high memory consumption). The information is displayed as (example:)
>> tn="Thread
>> > Group 1-1" (first digit group represents the thread group number, second
>> > digit group represents the thread number inside that particular thread
>> > group).
>> >
>> > --Adrian S
>> >
>> >
>> > On Wed, Jan 29, 2014 at 10:40 AM, ZK <st...@gmail.com> wrote:
>> >
>> >> Hi,
>> >> just add a  counter
>> >> <http://jmeter.apache.org/usermanual/component_reference.html#Counter>
>>  to
>> >> your thread group and reference the variable of that counter to find the
>> >> loop count
>> >>
>> >>
>> >> ZK
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://jmeter.512774.n5.nabble.com/Thread-group-Loop-count-How-can-I-tell-in-which-round-am-I-tp5719210p5719218.html
>> >> Sent from the JMeter - User mailing list archive at Nabble.com.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> >> For additional commands, e-mail: user-help@jmeter.apache.org
>> >>
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>>
>
>
> --
> Cordialement.
> Philippe Mouawad.

Re: Thread group Loop count: How can I tell in which round am I?

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,

What about adding a new feature to expose a variable containing this loop
number ?

The issue would be to ensure in nested loop name uniticity.

Regards



On Thu, Jan 30, 2014 at 12:27 PM, sebb <se...@gmail.com> wrote:

> On 30 January 2014 08:57, Adrian Speteanu <as...@gmail.com> wrote:
> > Not just like that, there is a method exposed:
> >
> http://people.apache.org/~mkostrze/jmeter-docs/docs/api/org/apache/jmeter/functions/ThreadNumber.html
> >
> > In the script, use this function (try the function helper for details):
>
> Or see http://jmeter.apache.org/usermanual/functions.html#__threadNum
>
> > ${__threadNum}
>
> That is the thread number, which does not vary.
> It is not the loop count within a thread.
>
> I think the only method to get the loop cound is to add a counter as
> already suggested.
>
>

> > The thread number is also exposed in test output (the jtl), several
> > listeners (View Results Table - don't use during high load because of its
> > high memory consumption). The information is displayed as (example:)
> tn="Thread
> > Group 1-1" (first digit group represents the thread group number, second
> > digit group represents the thread number inside that particular thread
> > group).
> >
> > --Adrian S
> >
> >
> > On Wed, Jan 29, 2014 at 10:40 AM, ZK <st...@gmail.com> wrote:
> >
> >> Hi,
> >> just add a  counter
> >> <http://jmeter.apache.org/usermanual/component_reference.html#Counter>
>  to
> >> your thread group and reference the variable of that counter to find the
> >> loop count
> >>
> >>
> >> ZK
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://jmeter.512774.n5.nabble.com/Thread-group-Loop-count-How-can-I-tell-in-which-round-am-I-tp5719210p5719218.html
> >> Sent from the JMeter - User mailing list archive at Nabble.com.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> >> For additional commands, e-mail: user-help@jmeter.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>


-- 
Cordialement.
Philippe Mouawad.

Re: Thread group Loop count: How can I tell in which round am I?

Posted by sebb <se...@gmail.com>.
On 30 January 2014 08:57, Adrian Speteanu <as...@gmail.com> wrote:
> Not just like that, there is a method exposed:
> http://people.apache.org/~mkostrze/jmeter-docs/docs/api/org/apache/jmeter/functions/ThreadNumber.html
>
> In the script, use this function (try the function helper for details):

Or see http://jmeter.apache.org/usermanual/functions.html#__threadNum

> ${__threadNum}

That is the thread number, which does not vary.
It is not the loop count within a thread.

I think the only method to get the loop cound is to add a counter as
already suggested.

> The thread number is also exposed in test output (the jtl), several
> listeners (View Results Table - don't use during high load because of its
> high memory consumption). The information is displayed as (example:) tn="Thread
> Group 1-1" (first digit group represents the thread group number, second
> digit group represents the thread number inside that particular thread
> group).
>
> --Adrian S
>
>
> On Wed, Jan 29, 2014 at 10:40 AM, ZK <st...@gmail.com> wrote:
>
>> Hi,
>> just add a  counter
>> <http://jmeter.apache.org/usermanual/component_reference.html#Counter>  to
>> your thread group and reference the variable of that counter to find the
>> loop count
>>
>>
>> ZK
>>
>>
>>
>> --
>> View this message in context:
>> http://jmeter.512774.n5.nabble.com/Thread-group-Loop-count-How-can-I-tell-in-which-round-am-I-tp5719210p5719218.html
>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>>

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


Re: Thread group Loop count: How can I tell in which round am I?

Posted by Adrian Speteanu <as...@gmail.com>.
Not just like that, there is a method exposed:
http://people.apache.org/~mkostrze/jmeter-docs/docs/api/org/apache/jmeter/functions/ThreadNumber.html

In the script, use this function (try the function helper for details):
${__threadNum}

The thread number is also exposed in test output (the jtl), several
listeners (View Results Table - don't use during high load because of its
high memory consumption). The information is displayed as (example:) tn="Thread
Group 1-1" (first digit group represents the thread group number, second
digit group represents the thread number inside that particular thread
group).

--Adrian S


On Wed, Jan 29, 2014 at 10:40 AM, ZK <st...@gmail.com> wrote:

> Hi,
> just add a  counter
> <http://jmeter.apache.org/usermanual/component_reference.html#Counter>  to
> your thread group and reference the variable of that counter to find the
> loop count
>
>
> ZK
>
>
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/Thread-group-Loop-count-How-can-I-tell-in-which-round-am-I-tp5719210p5719218.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

Re: Thread group Loop count: How can I tell in which round am I?

Posted by ZK <st...@gmail.com>.
Hi,
just add a  counter
<http://jmeter.apache.org/usermanual/component_reference.html#Counter>  to
your thread group and reference the variable of that counter to find the
loop count


ZK



--
View this message in context: http://jmeter.512774.n5.nabble.com/Thread-group-Loop-count-How-can-I-tell-in-which-round-am-I-tp5719210p5719218.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: Thread group Loop count: How can I tell in which round am I?

Posted by alexs <al...@gmail.com>.
Just want to verify:
In the thread group there is a loop count parameter that means how many
times to iterate the test plan , right?
So the __threadnum of a specific thread will no be changed in consecutive
iterations , right ?
I wish to know the iteration number. is this possible ?

Thanks




--
View this message in context: http://jmeter.512774.n5.nabble.com/Thread-group-Loop-count-How-can-I-tell-in-which-round-am-I-tp5719210p5719212.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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