You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Massas <mu...@hotmail.com> on 2009/03/31 13:54:18 UTC

JavaSampler not incrementing input variables

Hello all!

I'm having problems with a created java sampler. It works like a charm with
two input parameters passed on from counters in jMeter as long as i run in
multiple threads. However, if i run loops the input parameters seem to be
reset, which is my problem. 

Thread 1, loop 1, variable=1
Thread 2, loop 1, variable=2
Thread 1, loop 2, variable=1 (should it to be 3)
Thread 2, loop 2, variable=2 (and 4 here etc.)

The weird thing is that the variable is used in HTTP-samplers as well, where
i can see that it actually increments as it should, but the java sampler
doesn't seem to care about that...

Anyone have any hints on what I'm doing wrong?

Thanks in advance


-- 
View this message in context: http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p22803561.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: JavaSampler not incrementing input variables

Posted by Ekta Trivedi <ET...@mathematica-mpr.com>.
Try using http://www.jwebhosting.net/ site. The PetShop example works very
well and covers most of the scenarios.
This is very good site.

Hope this helps.

ET

-----Original Message-----
From: Hembha, Ambanna [mailto:ambanna.hembha@logica.com] 
Sent: Friday, April 03, 2009 8:18 AM
To: JMeter Users List
Subject: RE: JavaSampler not incrementing input variables

Hi, 

I need to test the performance testing of some web application(web
service), it is pretty urgent.

If soome one has any example mean steps of how to carry on the
performance testing, plese do send me across.
Awaiting for your response.

Thanks
Ambanna

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: 03 April 2009 10:11
To: JMeter Users List
Subject: Re: JavaSampler not incrementing input variables

On 03/04/2009, Massas <mu...@hotmail.com> wrote:
>
>
>  Massas wrote:
>  >
>  >
>  > Massas wrote:
>  >>
>  >>
>  >> sebb-2-2 wrote:
>  >>>
>  >>> On 31/03/2009, Massas <mu...@hotmail.com> wrote:
>  >>>>
>  >>>>  Hello all!
>  >>>>
>  >>>>  I'm having problems with a created java sampler. It works like 
> a charm  >>>> with  >>>>  two input parameters passed on from counters

> in jMeter as long as i  >>>> run in  >>>>  multiple threads. However, 
> if i run loops the input parameters seem to  >>>> be  >>>>  reset, 
> which is my problem.
>  >>>>
>  >>>>  Thread 1, loop 1, variable=1
>  >>>>  Thread 2, loop 1, variable=2
>  >>>>  Thread 1, loop 2, variable=1 (should it to be 3)  >>>>  Thread 
> 2, loop 2, variable=2 (and 4 here etc.)  >>>>  >>>>  The weird thing 
> is that the variable is used in HTTP-samplers as well,  >>>> where  
> >>>>  i can see that it actually increments as it should, but the java

> >>>> sampler  >>>>  doesn't seem to care about that...
>  >>>
>  >>> Are you saying that the increment does not work in the Java 
> Request  >>> Sampler provided with JMeter?
>  >>>
>  >>> If so, please open a Bugzilla issue and attach the simplest 
> possible  >>> test plan which shows the problem.
>  >>>
>  >>> Or does it work with that, and not your sampler?
>  >>>
>  >>>>  Anyone have any hints on what I'm doing wrong?
>  >>>
>  >>> If it's only your sampler that does not work, then compare your 
> code  >>> with the JMeter Java Request sampler.
>  >>>
>  >>>>  Thanks in advance
>  >>>>
>  >>>>
>  >>>>
>  >>>>  --
>  >>>>  View this message in context:
>  >>>> 
> http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp2
> 2803561p22803561.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
>  >>>
>  >>>
>  >>>
>  >>
>  >>
>  >> I had a feeling that i was way to unspecific when i posted this 
> message,  >> sorry about that.
>  >>
>  >> It is my own java sampler (that extends AbstractJavaSamplerClient)

> that  >> 'remembers' the first loops initial values, and ignore the 
> following  >> loops input variables.
>  >> I will look in to jMeters sampler and do some more digging  >> 
> Thanks for the answer!
>  >>
>  >> Regards, Massas
>  >>
>  >
>  > Hi Again.
>  >
>  > I still can't manage to get my sampler to use the incremented 
> variable  > over loops. Since I'm not very good at java, I'll try to 
> steal some time  > from a developer later this week, but if anyone has

> a hint until then, I'd  > be grateful.
>  >
>  > My sampler uses quite a lot from the sleeptest, should I consider 
> adding  > something to the teardownTest perhaps? Today it's just a 
> nice little  > ripoff:
>  >
>  >     public void teardownTest(JavaSamplerContext context) {
>  >         getLogger().debug(whoAmI() + "\tteardownTest()");
>  >         listParameters(context);
>  >     }
>  >
>  >
>
>
> I've noticed that the teardownTest() is only beeing called after all 
> loops  are finished, so putting stuff here is pretty useless.

It may be useless for your current purpose, but it's not useless in
general.

>  So rephrasing the question again then:
>  Why isn't teardownTest() called after each loop?

(It wouldn't be very well named would it?)

See the JavaSamplerClient interface.

You need the TestListener interface, but this is not implemented by the
standard Java samplers.

You might do better to have a look at one of the other examples under
src/examples.

>  Regards, Mats
>
> --
>  View this message in context: 
> http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp2
> 2803561p22863998.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



Please help Logica to respect the environment by not printing this email  /
Pour contribuer comme Logica au respect de l'environnment, merci de ne pas
imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen
Sie so Logica dabei die Umwelt zu schuetzen  /  Por favor ajude a Logica a
respeitar o ambiente nao imprimindo este correio electronico.



This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any attachment
and all copies and inform the sender. Thank you.



---------------------------------------------------------------------
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: JavaSampler not incrementing input variables

Posted by "Hembha, Ambanna" <am...@logica.com>.
Hi, 

I need to test the performance testing of some web application(web
service), it is pretty urgent.

If soome one has any example mean steps of how to carry on the
performance testing, plese do send me across.
Awaiting for your response.

Thanks
Ambanna

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: 03 April 2009 10:11
To: JMeter Users List
Subject: Re: JavaSampler not incrementing input variables

On 03/04/2009, Massas <mu...@hotmail.com> wrote:
>
>
>  Massas wrote:
>  >
>  >
>  > Massas wrote:
>  >>
>  >>
>  >> sebb-2-2 wrote:
>  >>>
>  >>> On 31/03/2009, Massas <mu...@hotmail.com> wrote:
>  >>>>
>  >>>>  Hello all!
>  >>>>
>  >>>>  I'm having problems with a created java sampler. It works like 
> a charm  >>>> with  >>>>  two input parameters passed on from counters

> in jMeter as long as i  >>>> run in  >>>>  multiple threads. However, 
> if i run loops the input parameters seem to  >>>> be  >>>>  reset, 
> which is my problem.
>  >>>>
>  >>>>  Thread 1, loop 1, variable=1
>  >>>>  Thread 2, loop 1, variable=2
>  >>>>  Thread 1, loop 2, variable=1 (should it to be 3)  >>>>  Thread 
> 2, loop 2, variable=2 (and 4 here etc.)  >>>>  >>>>  The weird thing 
> is that the variable is used in HTTP-samplers as well,  >>>> where  
> >>>>  i can see that it actually increments as it should, but the java

> >>>> sampler  >>>>  doesn't seem to care about that...
>  >>>
>  >>> Are you saying that the increment does not work in the Java 
> Request  >>> Sampler provided with JMeter?
>  >>>
>  >>> If so, please open a Bugzilla issue and attach the simplest 
> possible  >>> test plan which shows the problem.
>  >>>
>  >>> Or does it work with that, and not your sampler?
>  >>>
>  >>>>  Anyone have any hints on what I'm doing wrong?
>  >>>
>  >>> If it's only your sampler that does not work, then compare your 
> code  >>> with the JMeter Java Request sampler.
>  >>>
>  >>>>  Thanks in advance
>  >>>>
>  >>>>
>  >>>>
>  >>>>  --
>  >>>>  View this message in context:
>  >>>> 
> http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp2
> 2803561p22803561.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
>  >>>
>  >>>
>  >>>
>  >>
>  >>
>  >> I had a feeling that i was way to unspecific when i posted this 
> message,  >> sorry about that.
>  >>
>  >> It is my own java sampler (that extends AbstractJavaSamplerClient)

> that  >> 'remembers' the first loops initial values, and ignore the 
> following  >> loops input variables.
>  >> I will look in to jMeters sampler and do some more digging  >> 
> Thanks for the answer!
>  >>
>  >> Regards, Massas
>  >>
>  >
>  > Hi Again.
>  >
>  > I still can't manage to get my sampler to use the incremented 
> variable  > over loops. Since I'm not very good at java, I'll try to 
> steal some time  > from a developer later this week, but if anyone has

> a hint until then, I'd  > be grateful.
>  >
>  > My sampler uses quite a lot from the sleeptest, should I consider 
> adding  > something to the teardownTest perhaps? Today it's just a 
> nice little  > ripoff:
>  >
>  >     public void teardownTest(JavaSamplerContext context) {
>  >         getLogger().debug(whoAmI() + "\tteardownTest()");
>  >         listParameters(context);
>  >     }
>  >
>  >
>
>
> I've noticed that the teardownTest() is only beeing called after all 
> loops  are finished, so putting stuff here is pretty useless.

It may be useless for your current purpose, but it's not useless in
general.

>  So rephrasing the question again then:
>  Why isn't teardownTest() called after each loop?

(It wouldn't be very well named would it?)

See the JavaSamplerClient interface.

You need the TestListener interface, but this is not implemented by the
standard Java samplers.

You might do better to have a look at one of the other examples under
src/examples.

>  Regards, Mats
>
> --
>  View this message in context: 
> http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp2
> 2803561p22863998.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



Please help Logica to respect the environment by not printing this email  / Pour contribuer comme Logica au respect de l'environnment, merci de ne pas imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei die Umwelt zu schuetzen  /  Por favor ajude a Logica a respeitar o ambiente nao imprimindo este correio electronico.



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



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


Re: JavaSampler not incrementing input variables

Posted by Massas <mu...@hotmail.com>.

sebb-2-2 wrote:
> 
> On 03/04/2009, Massas <mu...@hotmail.com> wrote:
>>
>>
>>  Massas wrote:
>>  >
>>  >
>>  > Massas wrote:
>>  >>
>>  >>
>>  >> sebb-2-2 wrote:
>>  >>>
>>  >>> On 31/03/2009, Massas <mu...@hotmail.com> wrote:
>>  >>>>
>>  >>>>  Hello all!
>>  >>>>
>>  >>>>  I'm having problems with a created java sampler. It works like a
>> charm
>>  >>>> with
>>  >>>>  two input parameters passed on from counters in jMeter as long as
>> i
>>  >>>> run in
>>  >>>>  multiple threads. However, if i run loops the input parameters
>> seem to
>>  >>>> be
>>  >>>>  reset, which is my problem.
>>  >>>>
>>  >>>>  Thread 1, loop 1, variable=1
>>  >>>>  Thread 2, loop 1, variable=2
>>  >>>>  Thread 1, loop 2, variable=1 (should it to be 3)
>>  >>>>  Thread 2, loop 2, variable=2 (and 4 here etc.)
>>  >>>>
>>  >>>>  The weird thing is that the variable is used in HTTP-samplers as
>> well,
>>  >>>> where
>>  >>>>  i can see that it actually increments as it should, but the java
>>  >>>> sampler
>>  >>>>  doesn't seem to care about that...
>>  >>>
>>  >>> Are you saying that the increment does not work in the Java Request
>>  >>> Sampler provided with JMeter?
>>  >>>
>>  >>> If so, please open a Bugzilla issue and attach the simplest possible
>>  >>> test plan which shows the problem.
>>  >>>
>>  >>> Or does it work with that, and not your sampler?
>>  >>>
>>  >>>>  Anyone have any hints on what I'm doing wrong?
>>  >>>
>>  >>> If it's only your sampler that does not work, then compare your code
>>  >>> with the JMeter Java Request sampler.
>>  >>>
>>  >>>>  Thanks in advance
>>  >>>>
>>  >>>>
>>  >>>>
>>  >>>>  --
>>  >>>>  View this message in context:
>>  >>>>
>> http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p22803561.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
>>  >>>
>>  >>>
>>  >>>
>>  >>
>>  >>
>>  >> I had a feeling that i was way to unspecific when i posted this
>> message,
>>  >> sorry about that.
>>  >>
>>  >> It is my own java sampler (that extends AbstractJavaSamplerClient)
>> that
>>  >> 'remembers' the first loops initial values, and ignore the following
>>  >> loops input variables.
>>  >> I will look in to jMeters sampler and do some more digging
>>  >> Thanks for the answer!
>>  >>
>>  >> Regards, Massas
>>  >>
>>  >
>>  > Hi Again.
>>  >
>>  > I still can't manage to get my sampler to use the incremented variable
>>  > over loops. Since I'm not very good at java, I'll try to steal some
>> time
>>  > from a developer later this week, but if anyone has a hint until then,
>> I'd
>>  > be grateful.
>>  >
>>  > My sampler uses quite a lot from the sleeptest, should I consider
>> adding
>>  > something to the teardownTest perhaps? Today it's just a nice little
>>  > ripoff:
>>  >
>>  >     public void teardownTest(JavaSamplerContext context) {
>>  >         getLogger().debug(whoAmI() + "\tteardownTest()");
>>  >         listParameters(context);
>>  >     }
>>  >
>>  >
>>
>>
>> I've noticed that the teardownTest() is only beeing called after all
>> loops
>>  are finished, so putting stuff here is pretty useless.
> 
> It may be useless for your current purpose, but it's not useless in
> general.
> 
>>  So rephrasing the question again then:
>>  Why isn't teardownTest() called after each loop?
> 
> (It wouldn't be very well named would it?)
> 
> See the JavaSamplerClient interface.
> 
> You need the TestListener interface, but this is not implemented by
> the standard Java samplers.
> 
> You might do better to have a look at one of the other examples under
> src/examples.
> 
>>  Regards, Mats
>>
>> --
>>  View this message in context:
>> http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p22863998.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
> 
> 
> 
Doh! 
Sebb - thank you for you replies. The problem is now solved, it was (as
usually) my shortcomings that caused it. 
If someone else encounters the same problem i'll describe what i did wrong;
I initialised the variables in setuptest(), which is only called once. When
i put the initialisation in the runtest() it works like a charm..(I think i
read too much into not putting overhead in the runtest method)

Again, thanks, and a happy easter to all
-- 
View this message in context: http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p23002328.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: JavaSampler not incrementing input variables

Posted by sebb <se...@gmail.com>.
On 03/04/2009, Massas <mu...@hotmail.com> wrote:
>
>
>  Massas wrote:
>  >
>  >
>  > Massas wrote:
>  >>
>  >>
>  >> sebb-2-2 wrote:
>  >>>
>  >>> On 31/03/2009, Massas <mu...@hotmail.com> wrote:
>  >>>>
>  >>>>  Hello all!
>  >>>>
>  >>>>  I'm having problems with a created java sampler. It works like a charm
>  >>>> with
>  >>>>  two input parameters passed on from counters in jMeter as long as i
>  >>>> run in
>  >>>>  multiple threads. However, if i run loops the input parameters seem to
>  >>>> be
>  >>>>  reset, which is my problem.
>  >>>>
>  >>>>  Thread 1, loop 1, variable=1
>  >>>>  Thread 2, loop 1, variable=2
>  >>>>  Thread 1, loop 2, variable=1 (should it to be 3)
>  >>>>  Thread 2, loop 2, variable=2 (and 4 here etc.)
>  >>>>
>  >>>>  The weird thing is that the variable is used in HTTP-samplers as well,
>  >>>> where
>  >>>>  i can see that it actually increments as it should, but the java
>  >>>> sampler
>  >>>>  doesn't seem to care about that...
>  >>>
>  >>> Are you saying that the increment does not work in the Java Request
>  >>> Sampler provided with JMeter?
>  >>>
>  >>> If so, please open a Bugzilla issue and attach the simplest possible
>  >>> test plan which shows the problem.
>  >>>
>  >>> Or does it work with that, and not your sampler?
>  >>>
>  >>>>  Anyone have any hints on what I'm doing wrong?
>  >>>
>  >>> If it's only your sampler that does not work, then compare your code
>  >>> with the JMeter Java Request sampler.
>  >>>
>  >>>>  Thanks in advance
>  >>>>
>  >>>>
>  >>>>
>  >>>>  --
>  >>>>  View this message in context:
>  >>>> http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p22803561.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
>  >>>
>  >>>
>  >>>
>  >>
>  >>
>  >> I had a feeling that i was way to unspecific when i posted this message,
>  >> sorry about that.
>  >>
>  >> It is my own java sampler (that extends AbstractJavaSamplerClient) that
>  >> 'remembers' the first loops initial values, and ignore the following
>  >> loops input variables.
>  >> I will look in to jMeters sampler and do some more digging
>  >> Thanks for the answer!
>  >>
>  >> Regards, Massas
>  >>
>  >
>  > Hi Again.
>  >
>  > I still can't manage to get my sampler to use the incremented variable
>  > over loops. Since I'm not very good at java, I'll try to steal some time
>  > from a developer later this week, but if anyone has a hint until then, I'd
>  > be grateful.
>  >
>  > My sampler uses quite a lot from the sleeptest, should I consider adding
>  > something to the teardownTest perhaps? Today it's just a nice little
>  > ripoff:
>  >
>  >     public void teardownTest(JavaSamplerContext context) {
>  >         getLogger().debug(whoAmI() + "\tteardownTest()");
>  >         listParameters(context);
>  >     }
>  >
>  >
>
>
> I've noticed that the teardownTest() is only beeing called after all loops
>  are finished, so putting stuff here is pretty useless.

It may be useless for your current purpose, but it's not useless in general.

>  So rephrasing the question again then:
>  Why isn't teardownTest() called after each loop?

(It wouldn't be very well named would it?)

See the JavaSamplerClient interface.

You need the TestListener interface, but this is not implemented by
the standard Java samplers.

You might do better to have a look at one of the other examples under
src/examples.

>  Regards, Mats
>
> --
>  View this message in context: http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p22863998.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: JavaSampler not incrementing input variables

Posted by Massas <mu...@hotmail.com>.

Massas wrote:
> 
> 
> Massas wrote:
>> 
>> 
>> sebb-2-2 wrote:
>>> 
>>> On 31/03/2009, Massas <mu...@hotmail.com> wrote:
>>>>
>>>>  Hello all!
>>>>
>>>>  I'm having problems with a created java sampler. It works like a charm
>>>> with
>>>>  two input parameters passed on from counters in jMeter as long as i
>>>> run in
>>>>  multiple threads. However, if i run loops the input parameters seem to
>>>> be
>>>>  reset, which is my problem.
>>>>
>>>>  Thread 1, loop 1, variable=1
>>>>  Thread 2, loop 1, variable=2
>>>>  Thread 1, loop 2, variable=1 (should it to be 3)
>>>>  Thread 2, loop 2, variable=2 (and 4 here etc.)
>>>>
>>>>  The weird thing is that the variable is used in HTTP-samplers as well,
>>>> where
>>>>  i can see that it actually increments as it should, but the java
>>>> sampler
>>>>  doesn't seem to care about that...
>>> 
>>> Are you saying that the increment does not work in the Java Request
>>> Sampler provided with JMeter?
>>> 
>>> If so, please open a Bugzilla issue and attach the simplest possible
>>> test plan which shows the problem.
>>> 
>>> Or does it work with that, and not your sampler?
>>> 
>>>>  Anyone have any hints on what I'm doing wrong?
>>> 
>>> If it's only your sampler that does not work, then compare your code
>>> with the JMeter Java Request sampler.
>>> 
>>>>  Thanks in advance
>>>>
>>>>
>>>>
>>>>  --
>>>>  View this message in context:
>>>> http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p22803561.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
>>> 
>>> 
>>> 
>> 
>> 
>> I had a feeling that i was way to unspecific when i posted this message,
>> sorry about that.
>> 
>> It is my own java sampler (that extends AbstractJavaSamplerClient) that
>> 'remembers' the first loops initial values, and ignore the following
>> loops input variables. 
>> I will look in to jMeters sampler and do some more digging 
>> Thanks for the answer!
>> 
>> Regards, Massas
>> 
> 
> Hi Again.
> 
> I still can't manage to get my sampler to use the incremented variable
> over loops. Since I'm not very good at java, I'll try to steal some time
> from a developer later this week, but if anyone has a hint until then, I'd
> be grateful.
> 
> My sampler uses quite a lot from the sleeptest, should I consider adding
> something to the teardownTest perhaps? Today it's just a nice little
> ripoff:
> 
>     public void teardownTest(JavaSamplerContext context) {
>         getLogger().debug(whoAmI() + "\tteardownTest()");
>         listParameters(context);
>     } 
> 
> 

I've noticed that the teardownTest() is only beeing called after all loops
are finished, so putting stuff here is pretty useless.

So rephrasing the question again then: 
Why isn't teardownTest() called after each loop?

Regards, Mats
-- 
View this message in context: http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p22863998.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: JavaSampler not incrementing input variables

Posted by Massas <mu...@hotmail.com>.

Massas wrote:
> 
> 
> sebb-2-2 wrote:
>> 
>> On 31/03/2009, Massas <mu...@hotmail.com> wrote:
>>>
>>>  Hello all!
>>>
>>>  I'm having problems with a created java sampler. It works like a charm
>>> with
>>>  two input parameters passed on from counters in jMeter as long as i run
>>> in
>>>  multiple threads. However, if i run loops the input parameters seem to
>>> be
>>>  reset, which is my problem.
>>>
>>>  Thread 1, loop 1, variable=1
>>>  Thread 2, loop 1, variable=2
>>>  Thread 1, loop 2, variable=1 (should it to be 3)
>>>  Thread 2, loop 2, variable=2 (and 4 here etc.)
>>>
>>>  The weird thing is that the variable is used in HTTP-samplers as well,
>>> where
>>>  i can see that it actually increments as it should, but the java
>>> sampler
>>>  doesn't seem to care about that...
>> 
>> Are you saying that the increment does not work in the Java Request
>> Sampler provided with JMeter?
>> 
>> If so, please open a Bugzilla issue and attach the simplest possible
>> test plan which shows the problem.
>> 
>> Or does it work with that, and not your sampler?
>> 
>>>  Anyone have any hints on what I'm doing wrong?
>> 
>> If it's only your sampler that does not work, then compare your code
>> with the JMeter Java Request sampler.
>> 
>>>  Thanks in advance
>>>
>>>
>>>
>>>  --
>>>  View this message in context:
>>> http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p22803561.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
>> 
>> 
>> 
> 
> 
> I had a feeling that i was way to unspecific when i posted this message,
> sorry about that.
> 
> It is my own java sampler (that extends AbstractJavaSamplerClient) that
> 'remembers' the first loops initial values, and ignore the following loops
> input variables. 
> I will look in to jMeters sampler and do some more digging 
> Thanks for the answer!
> 
> Regards, Massas
> 

Hi Again.

I still can't manage to get my sampler to use the incremented variable over
loops. Since I'm not very good at java, I'll try to steal some time from a
developer later this week, but if anyone has a hint until then, I'd be
grateful.

My sampler uses quite a lot from the sleeptest, should I consider adding
something to the teardownTest perhaps? Today it's just a nice little ripoff:

    public void teardownTest(JavaSamplerContext context) {
        getLogger().debug(whoAmI() + "\tteardownTest()");
        listParameters(context);
    } 

-- 
View this message in context: http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p22804996.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: JavaSampler not incrementing input variables

Posted by Massas <mu...@hotmail.com>.

sebb-2-2 wrote:
> 
> On 31/03/2009, Massas <mu...@hotmail.com> wrote:
>>
>>  Hello all!
>>
>>  I'm having problems with a created java sampler. It works like a charm
>> with
>>  two input parameters passed on from counters in jMeter as long as i run
>> in
>>  multiple threads. However, if i run loops the input parameters seem to
>> be
>>  reset, which is my problem.
>>
>>  Thread 1, loop 1, variable=1
>>  Thread 2, loop 1, variable=2
>>  Thread 1, loop 2, variable=1 (should it to be 3)
>>  Thread 2, loop 2, variable=2 (and 4 here etc.)
>>
>>  The weird thing is that the variable is used in HTTP-samplers as well,
>> where
>>  i can see that it actually increments as it should, but the java sampler
>>  doesn't seem to care about that...
> 
> Are you saying that the increment does not work in the Java Request
> Sampler provided with JMeter?
> 
> If so, please open a Bugzilla issue and attach the simplest possible
> test plan which shows the problem.
> 
> Or does it work with that, and not your sampler?
> 
>>  Anyone have any hints on what I'm doing wrong?
> 
> If it's only your sampler that does not work, then compare your code
> with the JMeter Java Request sampler.
> 
>>  Thanks in advance
>>
>>
>>
>>  --
>>  View this message in context:
>> http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p22803561.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
> 
> 
> 


I had a feeling that i was way to unspecific when i posted this message,
sorry about that.

It is my own java sampler (that extends AbstractJavaSamplerClient) that
'remembers' the first loops initial values, and ignore the following loops
input variables. 
I will look in to jMeters sampler and do some more digging 
Thanks for the answer!

Regards, Massas
-- 
View this message in context: http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p22803969.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: JavaSampler not incrementing input variables

Posted by sebb <se...@gmail.com>.
On 31/03/2009, Massas <mu...@hotmail.com> wrote:
>
>  Hello all!
>
>  I'm having problems with a created java sampler. It works like a charm with
>  two input parameters passed on from counters in jMeter as long as i run in
>  multiple threads. However, if i run loops the input parameters seem to be
>  reset, which is my problem.
>
>  Thread 1, loop 1, variable=1
>  Thread 2, loop 1, variable=2
>  Thread 1, loop 2, variable=1 (should it to be 3)
>  Thread 2, loop 2, variable=2 (and 4 here etc.)
>
>  The weird thing is that the variable is used in HTTP-samplers as well, where
>  i can see that it actually increments as it should, but the java sampler
>  doesn't seem to care about that...

Are you saying that the increment does not work in the Java Request
Sampler provided with JMeter?

If so, please open a Bugzilla issue and attach the simplest possible
test plan which shows the problem.

Or does it work with that, and not your sampler?

>  Anyone have any hints on what I'm doing wrong?

If it's only your sampler that does not work, then compare your code
with the JMeter Java Request sampler.

>  Thanks in advance
>
>
>
>  --
>  View this message in context: http://www.nabble.com/JavaSampler-not-incrementing-input-variables-tp22803561p22803561.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