You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by sebb <se...@gmail.com> on 2004/11/25 17:43:33 UTC

Re: How to access the number of threads

This question really belongs on the JMeter developers list.

You need to use the current ThreadGroup, not create a new one.
I think there's a way to get at this, cannot remember offhand - I'll
have a look later.

S
On Thu, 25 Nov 2004 10:01:54 +0100,
deepak.angeswar@daimlerchrysler.com
<de...@daimlerchrysler.com> wrote:
> Hello,
> 
> I am presently working with the Jmeter src code
> to build my own sampler.
> 
> I need to make use of the numebr of threads,
> ramp time and loop count values.
> 
> In the src code I found the ThreadGroup class
> in the package org.apache.jmeter.threads.
> 
> Here I have the functions
> getNumThreads()
> getRampUp()
> and so on...
> 
> All these functions return int values.
> 
> In my program I imported the package
> org.apache.jmeter.threads
> create an object for class ThreadGroup.
> 
> I start jmeter from ant build and enter
> some values for threadgroup properties
> and access the thread functions thro the objects
> of ThreadGroup class.
> 
> But I dont get the values that i entered into jmeter
> 
> Where am I going wrong???
> 
> <!---
> --->
> ThreadGroup tg1 = new ThreadGroup();
> 
> int t1 = tg1.getDefaultNumThreads();
>         int t2 = tg1.getNumThreads();
>         int t3 = tg1.getDefaultRampUp();
>         int t4 = tg1.getRampUp();
>         long t5 = tg1.getDuration();
>         long t6 = tg1.getEndTime();
>         long t7 = tg1.getDelay();
>         String s11 = tg1.getName();
>         String s22 = tg1.getThreadName();
> 
> and i get the following values o/p
> 
> null(for the string)
> 1000000(for the integers returned)
> where 1 - DefaultNumThreads().
> 
> bye,
> with regards,
> Deepak.
> 
>

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