You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2015/12/09 13:34:43 UTC
svn commit: r1718835 -
/jmeter/trunk/src/core/org/apache/jmeter/threads/ThreadGroup.java
Author: pmouawad
Date: Wed Dec 9 12:34:42 2015
New Revision: 1718835
URL: http://svn.apache.org/viewvc?rev=1718835&view=rev
Log:
#resolve #52
Modified:
jmeter/trunk/src/core/org/apache/jmeter/threads/ThreadGroup.java
Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/ThreadGroup.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/ThreadGroup.java?rev=1718835&r1=1718834&r2=1718835&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/ThreadGroup.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/ThreadGroup.java Wed Dec 9 12:34:42 2015
@@ -268,14 +268,14 @@ public class ThreadGroup extends Abstrac
public void start(int groupCount, ListenerNotifier notifier, ListedHashTree threadGroupTree, StandardJMeterEngine engine) {
running = true;
int numThreads = getNumThreads();
- int rampUp = getRampUp();
- float perThreadDelay = ((float) (rampUp * 1000) / (float) getNumThreads());
+ int rampUpPeriodInSeconds = getRampUp();
+ float perThreadDelayInMillis = ((float) (rampUpPeriodInSeconds * 1000) / (float) getNumThreads());
delayedStartup = isDelayedStartup(); // Fetch once; needs to stay constant
log.info("Starting thread group number " + groupCount
+ " threads " + numThreads
- + " ramp-up " + rampUp
- + " perThread " + perThreadDelay
+ + " ramp-up " + rampUpPeriodInSeconds
+ + " perThread " + perThreadDelayInMillis
+ " delayedStart=" + delayedStartup);
if (delayedStartup) {
threadStarter = new Thread(new ThreadStarter(groupCount, notifier, threadGroupTree, engine), getName()+"-ThreadStarter");
@@ -288,7 +288,7 @@ public class ThreadGroup extends Abstrac
for (int i = 0; running && i < numThreads; i++) {
JMeterThread jmThread = makeThread(groupCount, notifier, threadGroupTree, engine, i, context);
scheduleThread(jmThread, now); // set start and end time
- jmThread.setInitialDelay((int)(i * perThreadDelay));
+ jmThread.setInitialDelay((int)(i * perThreadDelayInMillis));
Thread newThread = new Thread(jmThread, jmThread.getThreadName());
registerStartedThread(jmThread, newThread);
newThread.start();
@@ -558,10 +558,10 @@ public class ThreadGroup extends Abstrac
}
}
final int numThreads = getNumThreads();
- final int perTthreadDelay = Math.round(((float) (getRampUp() * 1000) / (float) numThreads));
+ final int perThreadDelayInMillis = Math.round(((float) (getRampUp() * 1000) / (float) numThreads));
for (int i = 0; running && i < numThreads; i++) {
if (i > 0) {
- pause(perTthreadDelay); // ramp-up delay (except first)
+ pause(perThreadDelayInMillis); // ramp-up delay (except first)
}
if (usingScheduler && System.currentTimeMillis() > endtime) {
break; // no point continuing beyond the end time