public class DslWeightedSwitchController extends BaseController<DslWeightedSwitchController>
Internally this uses BlazeMeter Weighted Switch Controller plugin.
This controller is handy when you want part of the test plan to act in a probabilistic manner switching between different alternatives.
If you configure for example children weights with (50, child1), (100, child2), (50, child3) and 10 iterations, then you will get this execution: child2, child1, child3, child2, child2, child1, child3, child2, child2, child1.
| Modifier and Type | Class and Description |
|---|---|
static class |
DslWeightedSwitchController.CodeBuilder |
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_WEIGHT |
childrenguiClass, name| Constructor and Description |
|---|
DslWeightedSwitchController() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.jmeter.testelement.TestElement |
buildTestElement() |
org.apache.jorphan.collections.HashTree |
buildTreeUnder(org.apache.jorphan.collections.HashTree parent,
BuildTreeContext context)
Builds the JMeter HashTree for this TestElement under the provided tree node.
|
DslWeightedSwitchController |
child(long weight,
DslController child)
Adds a child to the controller with a configured weight for selecting it in iterations.
|
DslWeightedSwitchController |
child(long weight,
DslSampler child)
Adds a child to the controller with a configured weight for selecting it in iterations.
|
DslWeightedSwitchController |
children(BaseThreadGroup.ThreadGroupChild... children)
Allows specifying children test elements which don't have an explicit weight associated.
|
buildConfiguredTestElement, buildTestElementGui, configureTestElement, durationToSeconds, loadBeanProperties, showAndWaitFrameWith, showFrameWith, showInGui, showTestElementGuiclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitshowInGuipublic static final long DEFAULT_WEIGHT
public DslWeightedSwitchController child(long weight, DslController child)
weight - is the weight to assign to this particular element for execution in iterations.
Keep in mind that if you use BaseThreadGroup.children(ThreadGroupChild...) to add
samplers or controllers, their default assigned weight will be 100.child - is the element to add as controller child that will be selected for execution
during iterations according to given weight.public DslWeightedSwitchController child(long weight, DslSampler child)
weight - is the weight to assign to this particular element for execution in iterations.
Keep in mind that if you use BaseThreadGroup.children(ThreadGroupChild...) to add
samplers or controllers, their default assigned weight will be 100.child - is the element to add as controller child that will be selected for execution
during iterations according to given weight.public DslWeightedSwitchController children(BaseThreadGroup.ThreadGroupChild... children)
This is method should mainly be used to add elements which weight does not affect like listeners, timers, assertions, pre- and post-processors and config elements.
Note: If a sampler or controller is added with this method, it's weight will default to 100.
children in class BaseController<DslWeightedSwitchController>children - list of test elements to add as children of this controller.public org.apache.jmeter.testelement.TestElement buildTestElement()
buildTestElement in class BaseTestElementpublic org.apache.jorphan.collections.HashTree buildTreeUnder(org.apache.jorphan.collections.HashTree parent,
BuildTreeContext context)
DslTestElementbuildTreeUnder in interface DslTestElementbuildTreeUnder in class TestElementContainer<DslWeightedSwitchController,BaseThreadGroup.ThreadGroupChild>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).Copyright © 2024. All rights reserved.