@Override public void sampleOccurred(SampleEvent event) { // just dropping regular test samples // update JMeterContext for share with samplers thread in order to provide // updated variables this.ctx = JMeterContextService.getContext(); }
@Override public void sampleOccurred(SampleEvent event) { // just dropping regular test samples // update JMeterContext for share with samplers thread in order to provide // updated variables this.ctx = JMeterContextService.getContext(); }
/** * * @return {@link JMeterContext} */ public JMeterContext getJMeterContext() { return JMeterContextService.getContext(); } /**
/** * @return {@link JMeterVariables} */ public final JMeterVariables getJMeterVariables() { return JMeterContextService.getContext().getVariables(); }
private JMeterVariables getVariables() { JMeterContext context = JMeterContextService.getContext(); return context.getVariables(); }
/** * Gives access to the JMeter variables for the current thread. * * @return a pointer to the JMeter variables. */ protected JMeterVariables getVariables() { return JMeterContextService.getContext().getVariables(); }
public AbstractThreadStarter(int groupIndex, AbstractDynamicThreadGroup owner, ListedHashTree listedHashTree, ListenerNotifier listenerNotifier, StandardJMeterEngine standardJMeterEngine) { super(); this.owner = owner; this.treeClone = cloneTree(listedHashTree); // it needs owner inside this.engine = standardJMeterEngine; this.groupIndex = groupIndex; this.threadGroupTree = listedHashTree; this.notifier = listenerNotifier; this.context = JMeterContextService.getContext(); setDaemon(true); }
public AbstractThreadStarter(int groupIndex, AbstractDynamicThreadGroup owner, ListedHashTree listedHashTree, ListenerNotifier listenerNotifier, StandardJMeterEngine standardJMeterEngine) { super(); this.owner = owner; this.treeClone = cloneTree(listedHashTree); // it needs owner inside this.engine = standardJMeterEngine; this.groupIndex = groupIndex; this.threadGroupTree = listedHashTree; this.notifier = listenerNotifier; this.context = JMeterContextService.getContext(); setDaemon(true); }
public AbstractThreadStarter(int groupIndex, AbstractDynamicThreadGroup owner, ListedHashTree listedHashTree, ListenerNotifier listenerNotifier, StandardJMeterEngine standardJMeterEngine) { super(); this.owner = owner; this.treeClone = cloneTree(listedHashTree); // it needs owner inside this.engine = standardJMeterEngine; this.groupIndex = groupIndex; this.threadGroupTree = listedHashTree; this.notifier = listenerNotifier; this.context = JMeterContextService.getContext(); setDaemon(true); }
private void processVariables() { final Arguments args1 = (Arguments) this.getUserDefinedVariablesAsProperty().getObjectValue(); Arguments args = (Arguments) args1.clone(); final JMeterVariables vars = JMeterContextService.getContext().getVariables(); Iterator<Entry<String, String>> it = args.getArgumentsAsMap().entrySet().iterator(); Entry<String, String> var; while (it.hasNext()) { var = it.next(); log.debug("Setting " + var.getKey() + "=" + var.getValue()); vars.put(var.getKey(), var.getValue()); } }
/** * Adjust delay so that initialDelay does not exceed end of test * @param initialDelay initial delay in millis * @return initialDelay or adjusted delay */ public long adjustDelay(final long initialDelay) { JMeterThread thread = JMeterContextService.getContext().getThread(); long endTime = thread != null ? thread.getEndTime() : 0; return adjustDelay(initialDelay, endTime); }
/** * @param elementName Test Element * @param iterCount iteration count */ default void updateIterationIndex(String elementName, int iterCount) { JMeterVariables variables = JMeterContextService.getContext().getVariables(); if(variables != null) { variables.putObject( JMeterUtils.formatJMeterExportedVariableName(elementName+GenericController.INDEX_VAR_NAME_SUFFIX), iterCount); } }
public String execute() { if (isDynamic || permanentResults == null) { JMeterContext context = JMeterContextService.getContext(); SampleResult previousResult = context.getPreviousResult(); Sampler currentSampler = context.getCurrentSampler(); return execute(previousResult, currentSampler); } return permanentResults; // $NON-NLS-1$ }
public String execute() throws InvalidVariableException { JMeterContext context = JMeterContextService.getContext(); SampleResult previousResult = context.getPreviousResult(); Sampler currentSampler = context.getCurrentSampler(); return execute(previousResult, currentSampler); }
@Override public void threadStarted() { if(getGroupSize() == 0) { int numThreadsInGroup = JMeterContextService.getContext().getThreadGroup().getNumThreads(); // Unique Barrier creation ensured by synchronized setup this.barrier.setup(numThreadsInGroup); } }
@Override public void run() { try { // Copy in ThreadStarter thread context from calling Thread JMeterContextService.getContext().setVariables(this.context.getVariables()); supplyActiveThreads(); } catch (InterruptedException e) { log.debug("Interrupted", e); } log.debug("Thread starter has done its job"); }
@Override public void run() { try { // Copy in ThreadStarter thread context from calling Thread JMeterContextService.getContext().setVariables(this.context.getVariables()); supplyActiveThreads(); } catch (InterruptedException e) { log.debug("Interrupted", e); } log.debug("Thread starter has done its job"); }
public void startNextLoop() { JMeterThread thread = JMeterContextService.getContext().getThread(); if (owner instanceof ArrivalsThreadGroup) { getOwnerAsArrivals().abandonFact(thread, iterationNo); } if (!moveToPool(thread)) { setDone(true); } }
public void startNextLoop() { JMeterThread thread = JMeterContextService.getContext().getThread(); if (owner instanceof ArrivalsThreadGroup) { getOwnerAsArrivals().abandonFact(thread, iterationNo); if (!moveToPool(thread)) { setDone(true); } } else { reInitialize(); } }
public void startNextLoop() { JMeterThread thread = JMeterContextService.getContext().getThread(); if (owner instanceof ArrivalsThreadGroup) { getOwnerAsArrivals().abandonFact(thread, iterationNo); if (!moveToPool(thread)) { setDone(true); } } else { reInitialize(); } }