org.apache.jmeter.threads

Class JMeterContextService


public final class JMeterContextService
extends Object

Method Summary

static void
addTotalThreads(int thisGroup)
static void
clearTotalThreads()
static void
endTest()
static JMeterContext
getContext()
static int
getNumberOfThreads()
static long
getTestStartTime()
static int
getTotalThreads()
static void
startTest()

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Details

addTotalThreads

public static void addTotalThreads(int thisGroup)
Usages and Demos :

View More Examples of addTotalThreads(int thisGroup)
   1: import org.apache.jmeter.testelement.TestPlan;
   2: import org.apache.jmeter.threads.JMeterContextService;
   3: import org.apache.jmeter.threads.JMeterThread;
   4:         ...
   5:         }
   6:         JMeterContextService.startTest();
   7:         try {
   8:         ...
   9:         schcdule_run = true;
  10:         JMeterContextService.getContext().setSamplingStarted(true);
  11:         int groupCount = 0;
  12:         ...
  13:             int numThreads = group.getNumThreads();
  14:             JMeterContextService.addTotalThreads(numThreads);

View Full Code Here

clearTotalThreads

public static void clearTotalThreads()
Usages and Demos :

View More Examples of clearTotalThreads()
   1: import org.apache.jmeter.testelement.TestPlan;
   2: import org.apache.jmeter.threads.JMeterContextService;
   3: import org.apache.jmeter.threads.JMeterThread;
   4:         ...
   5:         }
   6:         JMeterContextService.startTest();
   7:         try {
   8:         ...
   9:         schcdule_run = true;
  10:         JMeterContextService.getContext().setSamplingStarted(true);
  11:         int groupCount = 0;
  12:         ...
  13:         JMeterContextService.clearTotalThreads();

View Full Code Here

endTest

public static void endTest()
Usages and Demos :

View More Examples of endTest()
   1: import org.apache.jmeter.testelement.TestListener;
   2: import org.apache.jmeter.threads.JMeterContextService;
   3: import org.apache.jmeter.util.JMeterUtils;
   4:         ...
   5:             public void run() {
   6:                 activeThreads.setText(Integer.toString(JMeterContextService.getNumberOfThreads()));
   7:         ...
   8:                 totalThreads.setText(Integer.toString(JMeterContextService.getTotalThreads()));
   9:             }
  10:         ...
  11:             runningIndicator.setIcon(stoppedIcon);
  12:             JMeterContextService.endTest();

View Full Code Here

getContext

public static JMeterContext getContext()
Usages and Demos :

View More Examples of getContext()
   1: import org.apache.jmeter.threads.JMeterContext;
   2: import org.apache.jmeter.threads.JMeterContextService;
   3: import org.apache.jmeter.threads.JMeterVariables;
   4:         ...
   5:     public String execute() throws InvalidVariableException {
   6:         JMeterContext context = JMeterContextService.getContext();
   7:         SampleResult previousResult = context.getPreviousResult();
   8:         ...
   9:     protected JMeterVariables getVariables() {
  10:         return JMeterContextService.getContext().getVariables();
  11:     }

View Full Code Here
   1: import org.apache.jmeter.testelement.TestPlan;
   2: import org.apache.jmeter.threads.JMeterContextService;
   3: import org.apache.jmeter.threads.JMeterVariables;
   4:         ...
   5:             vars.putAll(args);
   6:             JMeterContextService.getContext().setVariables(vars);
   7:         } 
   8:         ...
   9:             replacer.addVariables(args);
  10:             JMeterContextService.getContext().getVariables().putAll(args);
  11:         }

View Full Code Here
   1: import org.apache.jmeter.testelement.property.StringProperty;
   2: import org.apache.jmeter.threads.JMeterContextService;
   3: import org.apache.jmeter.threads.JMeterVariables;
   4:         ...
   5:             vars.put("server", "jakarta.apache.org");
   6:             JMeterContextService.getContext().setVariables(vars);
   7:         ...
   8:             JMeterContextService.getContext().setSamplingStarted(true);
   9:         }
  10:         ...
  11:         protected void tearDown() throws Exception {
  12:             JMeterContextService.getContext().setSamplingStarted(false);

View Full Code Here
   1: import org.apache.jmeter.testelement.property.StringProperty;
   2: import org.apache.jmeter.threads.JMeterContextService;
   3: import org.apache.jmeter.threads.JMeterThread;
   4:         ...
   5:             } else {
   6:                 JMeterVariables threadVars = JMeterContextService.getContext().getVariables();
   7:             }
   8:         } else {
   9:         }

View Full Code Here
   1: import org.apache.jmeter.testelement.property.LongProperty;
   2: import org.apache.jmeter.threads.JMeterContextService;
   3: import org.apache.jmeter.threads.JMeterVariables;
   4:         ...
   5:     public synchronized void iterationStart(LoopIterationEvent event) {
   6:         JMeterVariables variables = JMeterContextService.getContext().getVariables();
   7:         long start = getStart(), end = getEnd(), increment = getIncrement();
   8:         if (!isPerUser()) {
   9:             if (globalCounter == Long.MIN_VALUE || globalCounter > end) {

View Full Code Here

getNumberOfThreads

public static int getNumberOfThreads()

getTestStartTime

public static long getTestStartTime()

getTotalThreads

public static int getTotalThreads()
Usages and Demos :

View More Examples of getTotalThreads()
   1: import org.apache.jmeter.testelement.TestListener;
   2: import org.apache.jmeter.threads.JMeterContextService;
   3: import org.apache.jmeter.util.JMeterUtils;
   4:         ...
   5:             public void run() {
   6:                 activeThreads.setText(Integer.toString(JMeterContextService.getNumberOfThreads()));
   7:         ...
   8:                 totalThreads.setText(Integer.toString(JMeterContextService.getTotalThreads()));
   9:             }
  10:         ...
  11:             runningIndicator.setIcon(stoppedIcon);
  12:             JMeterContextService.endTest();

View Full Code Here

startTest

public static void startTest()
Usages and Demos :

View More Examples of startTest()
   1: import org.apache.jmeter.testelement.TestPlan;
   2: import org.apache.jmeter.threads.JMeterContextService;
   3: import org.apache.jmeter.threads.JMeterThread;
   4:         ...
   5:         }
   6:         JMeterContextService.startTest();
   7:         try {
   8:         ...
   9:         schcdule_run = true;
  10:         JMeterContextService.getContext().setSamplingStarted(true);
  11:         int groupCount = 0;
  12:         ...
  13:         JMeterContextService.clearTotalThreads();

View Full Code Here