Class DslCounter
- java.lang.Object
-
- us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
-
- us.abstracta.jmeter.javadsl.core.configs.BaseConfigElement
-
- us.abstracta.jmeter.javadsl.core.configs.DslCounter
-
- All Implemented Interfaces:
DslConfig,DslTestElement,DslTestPlan.TestPlanChild,BaseSampler.SamplerChild,MultiLevelTestElement,BaseThreadGroup.ThreadGroupChild
public class DslCounter extends BaseConfigElement
Allows easy usage of auto incremental values in test plans.This element is handy for generating incremental IDs, positions in certain list, etc.
- Since:
- 1.10
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDslCounter.CodeBuilder
-
Field Summary
-
Fields inherited from class us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
guiClass, name
-
-
Constructor Summary
Constructors Constructor Description DslCounter(String varName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.jmeter.testelement.TestElementbuildTestElement()DslCounterincrement(long inc)Specifies how much the counter will increase in each iteration.DslCountermaximumValue(long max)Specifies the maximum value of the counter.DslCounterperThread(boolean perThread)Specifies to use a separate counter for each thread.DslCounterstartingValue(long start)Allows specifying the starting value of the counter.DslCounterstartingValue(String start)Same asstartingValue(long)but allowing to use JMeter expressions for starting value.-
Methods inherited from class us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
buildConfiguredTestElement, buildTestElementGui, buildTreeUnder, configureTestElement, durationToSeconds, loadBeanProperties, showAndWaitFrameWith, showFrameWith, showInGui, showTestElementGui
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface us.abstracta.jmeter.javadsl.core.DslTestElement
buildTreeUnder, showInGui
-
-
-
-
Constructor Detail
-
DslCounter
public DslCounter(String varName)
-
-
Method Detail
-
startingValue
public DslCounter startingValue(long start)
Allows specifying the starting value of the counter.- Parameters:
start- specifies the value to start the counter with. When not specified, 0 will be used.- Returns:
- the counter for further configuration and usage.
-
startingValue
public DslCounter startingValue(String start)
Same asstartingValue(long)but allowing to use JMeter expressions for starting value.This method allows to extract the initial value of the counter for example from a JMeter property (eg: ${__P(COUNT_INIT)}).
- Parameters:
start- specifies a jmeter expression evaluating to a number that specifies the initial value for the counter.- Returns:
- the counter for further configuration and usage.
-
increment
public DslCounter increment(long inc)
Specifies how much the counter will increase in each iteration.- Parameters:
inc- specifies how much to increase the counter in each iteration. By default, 1.- Returns:
- the counter for further configuration and usage.
- Since:
- 1.22
-
maximumValue
public DslCounter maximumValue(long max)
Specifies the maximum value of the counter.When the value exceeds this value, the counter is reset to its starting value.
- Parameters:
max- specifies the maximum value to use. When not specified,Long.MAX_VALUEis used.- Returns:
- the counter for further configuration and usage.
- Since:
- 1.22
-
perThread
public DslCounter perThread(boolean perThread)
Specifies to use a separate counter for each thread.- Parameters:
perThread- specifies to use a separate counter for each thread. When not specified, then the counter is shared, and incremented, by all thread group threads. By default, it is set to false.- Returns:
- the counter for further configuration and usage.
- Since:
- 1.22
-
buildTestElement
protected org.apache.jmeter.testelement.TestElement buildTestElement()
- Specified by:
buildTestElementin classBaseTestElement
-
-