From Wed Sep 04 00:14:34 2002 Return-Path: Delivered-To: Received: (qmail 71017 invoked from network); 4 Sep 2002 00:14:34 -0000 Received: from unknown (HELO ( by with SMTP; 4 Sep 2002 00:14:34 -0000 Received: (qmail 16880 invoked by uid 97); 4 Sep 2002 00:15:12 -0000 Delivered-To: Received: (qmail 16863 invoked by uid 97); 4 Sep 2002 00:15:11 -0000 Mailing-List: contact; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "JMeter Users List" Reply-To: "JMeter Users List" Delivered-To: mailing list Received: (qmail 16851 invoked by uid 98); 4 Sep 2002 00:15:10 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Reply-To: From: "Jonathan O'Keeffe" To: "JMeter Users List" Subject: RE: Timer Question Date: Tue, 3 Sep 2002 20:14:34 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 In-reply-to: X-Spam-Rating: 1.6.2 0/1000/N X-Spam-Rating: 1.6.2 0/1000/N Amir - On your #1, your assumption is correct - each thread gets its own timer value. On your #2, Random.nextDouble() returns a value that is in the range [0.0, 1.0), with an even distribution throughout the range. Random.nextGaussian produces a value that has a "normal" or Gaussian distribution (a bell-shaped curve), with a mean of 0.0 and a standard distribution of 1.0. This means that it will produce both positive and negative values, and that values closer to zero are more likely to be returned than values farther from zero (roughly speaking). As a practical matter with respect to the Timer services, this means that if you have a UniformRandomTimer with a random delay of 1000 ms and a constant offset of 5000 ms, you will get delays in the range [5000, 6000) ms, and every delay in the range will be equally likely to occur - a delay of 5001 ms is just as likely as a delay of 5999 ms. If you have a GaussianRandomTimer with a random delay of 1000 ms and a constant offset of 5000, you will get delays centered around 5000 ms with a bell-shaped distribution that has a standard deviation of 1000. Most values (around 95%) will be between 3000 and 7000, and many of them (around 68%) will be between 4000 and 6000. However, there will be some outliers - occasionally you might get a delay of 1500 ms, or 9000 ms, or something like that, although these extreme values will be very uncommon. A Gaussian distribution like the one obtained from GaussianRandomTimer is often a good way to model real-world phenomena. For example, if you're trying to model an application where the user spends an average of 10 seconds looking at a page before moving on to the next page, a GaussianRandomTimer with an offset of 10000 ms and a delay of around 2000 will produce values that look a lot like the real-world times that people spend reading the page. To get a better sense for how this works, you can write a simple test, like this: RandomTimer timer = new GaussianRandomTimer(); timer.setDelay(5000); timer.setRange(1000); System.out.println("Gaussian Delays"); for (int i = 0; i < 100; ++i) { System.out.println(timer.delay()); } timer = new UniformRandomTimer(); timer.setDelay(5000); timer.setRange(1000); System.out.println("Uniform Delays"); for (int i = 0; i < 100; ++i) { System.out.println(timer.delay()); } Take a look at the values that get generated, or paste them into Excel, and the difference should become clear. Hope this helps. - Jonathan -----Original Message----- From: Amir Nashat [mailto:anashat@CJ.COM] Sent: Tuesday, September 03, 2002 7:16 PM To: Subject: Re: Timer Question Mike, Thank you for your response. It was very helpful. I plugged away some values and played with the UI and seem to have a better understanding of how the timers work. I have come along a couple of more questions in which I was wondering if you could help out. They are: 1) Assume you have 2 threads ( or samples as you call them) and you are using a UniformRandomTimer. The random delay in milliseconds is 1000 and the constant delay is 5000 milliseconds. Now the UniformRandomTimer service takes these two values and spits out a delay for the first thread. Does the second thread then also call the UniformRandomTimer service and get its own delay as well or is the first delay that was calculated used for both threads? I am assuming each thread calls the UniformRandomTimer service uniquely and generates its own delay using the random delay and constant delay mentioned above. 2) In looking through the source code for UniformRandomTimer and GaussianRandomTimer they both use methods from the Random class. Looking through the Random API I can't really differentiate how nextDouble and nextGaussian really generate different results. Thus, I can't see the difference between the Uniform and Gaussian Timer services. Basically, if you use the same values for the random delay(let's say 1000 ms) and constant delay(say 5000 ms) for the Uniform timer as for the deviation(again 1000 ms) and constant delay (again 5000 ms) how would the results differ? Sorry if I have made this a bigger mess then I probably need to but I would like to get a clear understanding of the delay that these services provide in order to simulate a real world environment. amir >>> 1:55:57 PM 09/03/02 >>> Constant timer creates a delay between each sample that is the same for all samples. Gaussian random creates a delay that will average X milliseconds, but in such a way as to create a bell-shaped distribution around that average. The average is the sum of the offset (minimum delay) and the deviation (the range of values). Uniform random timer creates a uniform distribution around the average. -Mike On 3 Sep 2002 at 10:25, Amir Nashat wrote: > Hello all, > > I asked this on Friday but I have had no response so I will ask again. Can anyone explain the difference between the timer options? The documentation is pretty sparse. Any examples of which to use in what situation would be helpful. I have researched the faq, help and gone through google but not much has been explained. Any help would be appreciated. > > > TIA > amir > > > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > -- Michael Stover Yahoo IM: mstover_ya ICQ: 152975688 -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: