Class AutoStopListener
- java.lang.Object
-
- us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
-
- us.abstracta.jmeter.javadsl.core.listeners.AutoStopListener
-
- All Implemented Interfaces:
DslTestElement,DslTestPlan.TestPlanChild,DslListener,BaseSampler.SamplerChild,MultiLevelTestElement,BaseThreadGroup.ThreadGroupChild
public class AutoStopListener extends BaseTestElement implements DslListener
Allows stopping a test plan execution when collected statistics meet some defined criteria.- Since:
- 1.19
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAutoStopListener.AggregatedConditionBuilder<T extends Comparable<?>>static classAutoStopListener.AutoStopConditionSpecifies a condition that when met, will make test plan execution to stop.static classAutoStopListener.AutoStopConditionBuilderstatic classAutoStopListener.BaseAutoStopConditionBuilderstatic classAutoStopListener.CountMetricConditionBuilderstatic classAutoStopListener.ErrorsConditionBuilderstatic classAutoStopListener.MetricConditionBuilderstatic classAutoStopListener.TimeMetricConditionBuilder
-
Field Summary
Fields Modifier and Type Field Description protected List<AutoStopListener.AutoStopCondition>conditionsprotected Patternregexprotected TestStoppertestStopper-
Fields inherited from class us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
guiClass, name
-
-
Constructor Summary
Constructors Constructor Description AutoStopListener(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.jmeter.testelement.TestElementbuildTestElement()org.apache.jorphan.collections.HashTreebuildTreeUnder(org.apache.jorphan.collections.HashTree parent, BuildTreeContext context)Builds the JMeter HashTree for this TestElement under the provided tree node.AutoStopListenersamplesMatching(String regex)Specifies a regular expression used to filter samples for which specified conditions will be evaluated.AutoStopListenerwhen(AutoStopListener.AutoStopCondition condition)Specifies conditions that when met will cause the test plan execution to stop.-
Methods inherited from class us.abstracta.jmeter.javadsl.core.testelements.BaseTestElement
buildConfiguredTestElement, buildTestElementGui, 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
showInGui
-
-
-
-
Field Detail
-
conditions
protected final List<AutoStopListener.AutoStopCondition> conditions
-
regex
protected Pattern regex
-
testStopper
protected TestStopper testStopper
-
-
Constructor Detail
-
AutoStopListener
public AutoStopListener(String name)
-
-
Method Detail
-
samplesMatching
public AutoStopListener samplesMatching(String regex)
Specifies a regular expression used to filter samples for which specified conditions will be evaluated.If a condition defines another regular expression, then this expression is ignored for such condition.
This is handy in case you want to define a set of conditions that apply only to a sub set of samples that share a common label structure. Eg: to samplers with same name but in different parts of test plan (e.g.: under different ifControllers).
For targeting a single sampler or all the samplers contained within a controller or thread group, prefer just placing the autoStop listener in the correct scope of the test plan.
- Parameters:
regex- specifies the regular expression to filter samples.- Returns:
- the listener for further configuration or usage in a test plan.
-
when
public AutoStopListener when(AutoStopListener.AutoStopCondition condition)
Specifies conditions that when met will cause the test plan execution to stop.- Parameters:
condition- specifies the condition that samples will be evaluated against.- Returns:
- the listener for further configuration or usage in a test plan.
-
buildTreeUnder
public org.apache.jorphan.collections.HashTree buildTreeUnder(org.apache.jorphan.collections.HashTree parent, BuildTreeContext context)Description copied from interface:DslTestElementBuilds the JMeter HashTree for this TestElement under the provided tree node.- Specified by:
buildTreeUnderin interfaceDslTestElement- Overrides:
buildTreeUnderin classBaseTestElement- Parameters:
parent- the node which will be the parent for the created tree.context- context information which contains information shared by elements while building the test plan tree (eg: adding additional items to test plan when a particular protocol element is added).- Returns:
- The tree created under the parent node.
-
buildTestElement
protected org.apache.jmeter.testelement.TestElement buildTestElement()
- Specified by:
buildTestElementin classBaseTestElement
-
-