@Override public int getIteration() { return variables.getIteration(); }
@Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { return String.valueOf(getVariables().getIteration()); }
@Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { return String.valueOf(getVariables().getIteration()); }
void notifyTestListeners() { threadVars.incIteration(); for (TestIterationListener listener : testIterationStartListeners) { listener.testIterationStart(new LoopIterationEvent(threadGroupLoopController, threadVars.getIteration())); if (listener instanceof TestElement) { ((TestElement) listener).recoverRunningVersion(); } } }
long current = perTheadNumber.get().longValue(); if(isResetOnThreadGroupIteration()) { int iteration = variables.getIteration(); Long lastIterationNumber = perTheadLastIterationNumber.get(); if(iteration != lastIterationNumber.longValue()) {
/** * Executes the function (and caches the value for the duration of the test * iteration) if the property is a running version. Otherwise, the raw * string representation of the function is provided. * * @see JMeterProperty#getStringValue() */ @Override public String getStringValue() { JMeterContext ctx = JMeterContextService.getContext();// Expensive, so // do // once if (!isRunningVersion() /*|| !ctx.isSamplingStarted()*/) { log.debug("Not running version, return raw function string"); return function.getRawParameters(); } if(!ctx.isSamplingStarted()) { return function.execute(); } log.debug("Running version, executing function"); int iter = ctx.getVariables() != null ? ctx.getVariables().getIteration() : -1; if (iter < testIteration) { testIteration = -1; } if (iter > testIteration || cacheValue == null) { testIteration = iter; cacheValue = function.execute(); } return cacheValue; }