kg.apc.jmeter.functions.IterationNum Maven / Gradle / Ivy
package kg.apc.jmeter.functions;
import org.apache.jmeter.engine.util.CompoundVariable;
import org.apache.jmeter.functions.AbstractFunction;
import org.apache.jmeter.functions.InvalidVariableException;
import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.samplers.Sampler;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
public class IterationNum extends AbstractFunction {
private static final List desc = new LinkedList();
private static final String KEY = "__iterationNum";
@Override
public synchronized String execute(SampleResult previousResult, Sampler currentSampler)
throws InvalidVariableException {
return String.valueOf(getVariables().getIteration());
}
@Override
public synchronized void setParameters(Collection parameters) throws InvalidVariableException {
}
@Override
public String getReferenceKey() {
return KEY;
}
@Override
public List getArgumentDesc() {
return desc;
}
}