You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Tech Newbie <te...@yahoo.com> on 2009/09/30 08:01:31 UTC

Access JMeter functions and properties from JavaSampler

Can I access JMeter functions and properties from my own JavaSampler?  For example, how do I get the thread group name and thread number so I can print this out?  Also, can I define properties using the -J command line option and retrieve that value from my JavaSampler?

Thanks in advance.



      

Re: Access JMeter functions and properties from JavaSampler

Posted by sebb <se...@gmail.com>.
On 30/09/2009, Tech Newbie <te...@yahoo.com> wrote:
> How do I "run the code directly" in my JavaSampler?  Is there an API I can use?
>
>  I am having trouble locating the right documentation.  All the ones I have found, like this one:  http://jakarta.apache.org/jmeter/usermanual/functions.html, shows how to setup in the GUI or in a test plan.  It's not clear to me how to invoke functions or retrieve properties from a java program.  Please point me to an example.

http://svn.apache.org/repos/asf/jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/ThreadNumber.java

>  Thanks.
>
>  --- On Wed, 9/30/09, sebb <se...@gmail.com> wrote:
>
>  From: sebb <se...@gmail.com>
>  Subject: Re: Access JMeter functions and properties from JavaSampler
>  To: "JMeter Users List" <jm...@jakarta.apache.org>
>  Date: Wednesday, September 30, 2009, 9:35 AM
>
>
>  On 30/09/2009, Tech Newbie <te...@yahoo.com> wrote:
>  > Can I access JMeter functions and properties from my own JavaSampler?
>
>  Yes, of course (they are Java) but that's not as efficient as running
>  the code directly, because functions need additional setup.
>
>  > For example, how do I get the thread group name and thread number so I can print this out?
>
>  Have a look at the relevant function and see how it does it.
>
>  > Also, can I define properties using the -J command line option and retrieve that value from my JavaSampler?
>  >
>  >  Thanks in advance.
>  >
>  >
>  >
>  >
>
>
> ---------------------------------------------------------------------
>  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: Access JMeter functions and properties from JavaSampler

Posted by Tech Newbie <te...@yahoo.com>.
How do I "run the code directly" in my JavaSampler?  Is there an API I can use?

I am having trouble locating the right documentation.  All the ones I have found, like this one:  http://jakarta.apache.org/jmeter/usermanual/functions.html, shows how to setup in the GUI or in a test plan.  It's not clear to me how to invoke functions or retrieve properties from a java program.  Please point me to an example.

Thanks.

--- On Wed, 9/30/09, sebb <se...@gmail.com> wrote:

From: sebb <se...@gmail.com>
Subject: Re: Access JMeter functions and properties from JavaSampler
To: "JMeter Users List" <jm...@jakarta.apache.org>
Date: Wednesday, September 30, 2009, 9:35 AM

On 30/09/2009, Tech Newbie <te...@yahoo.com> wrote:
> Can I access JMeter functions and properties from my own JavaSampler?

Yes, of course (they are Java) but that's not as efficient as running
the code directly, because functions need additional setup.

> For example, how do I get the thread group name and thread number so I can print this out?

Have a look at the relevant function and see how it does it.

> Also, can I define properties using the -J command line option and retrieve that value from my JavaSampler?
>
>  Thanks in advance.
>
>
>
>

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




      

Re: Access JMeter functions and properties from JavaSampler

Posted by sebb <se...@gmail.com>.
On 30/09/2009, Tech Newbie <te...@yahoo.com> wrote:
> Can I access JMeter functions and properties from my own JavaSampler?

Yes, of course (they are Java) but that's not as efficient as running
the code directly, because functions need additional setup.

> For example, how do I get the thread group name and thread number so I can print this out?

Have a look at the relevant function and see how it does it.

> Also, can I define properties using the -J command line option and retrieve that value from my JavaSampler?
>
>  Thanks in advance.
>
>
>
>

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