Provides context service for JMeter threads.
Keeps track of active and total thread counts.
Method from org.apache.jmeter.threads.JMeterContextService Detail: |
public static synchronized void addTotalThreads(int thisGroup) {
totalThreads += thisGroup;
}
Update the total number of threads |
public static synchronized void clearTotalThreads() {
totalThreads = 0;
}
Set total threads to zero |
static synchronized void decrNumberOfThreads() {
numberOfActiveThreads--;
}
Decrement number of active threads. |
public static synchronized void endTest() {
testStart = 0;
}
Called by MainFrame#testEnded().
Clears start time field. |
public static JMeterContext getContext() {
return (JMeterContext) threadContext.get();
}
Gives access to the current thread context. |
public static synchronized int getNumberOfThreads() {
return numberOfActiveThreads;
}
Get the number of currently active threads |
public static synchronized long getTestStartTime() {
// NOT USED
return testStart;
}
|
public static synchronized int getTotalThreads() {
return totalThreads;
}
Get the total number of threads (>= active) |
static synchronized void incrNumberOfThreads() {
numberOfActiveThreads++;
}
Increment number of active threads. |
public static synchronized void startTest() {
if (testStart == 0) {
numberOfActiveThreads = 0;
testStart = System.currentTimeMillis();
JMeterUtils.setProperty("TESTSTART.MS",Long.toString(testStart));// $NON-NLS-1$
}
}
Method is called by the JMeterEngine class when a test run is started.
Zeroes numberOfActiveThreads.
Saves current time in a field and in the JMeter property "TESTSTART.MS" |