diff --git a/jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/controllers/DslWeightedSwitchController.java b/jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/controllers/DslWeightedSwitchController.java index 9081d56d..5be3351f 100644 --- a/jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/controllers/DslWeightedSwitchController.java +++ b/jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/controllers/DslWeightedSwitchController.java @@ -29,7 +29,8 @@ * Selects a child in each iteration according to specified relative weights. *
* Internally this uses + * href="https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/wsc + * /WeightedSwitchController.md"> * BlazeMeter Weighted Switch Controller plugin. *
* This controller is handy when you want part of the test plan to act in a probabilistic manner @@ -57,10 +58,10 @@ public DslWeightedSwitchController() { * Adds a child to the controller with a configured weight for selecting it in iterations. * * @param weight is the weight to assign to this particular element for execution in iterations. - * Keep in mind that if you use {@link #children(ThreadGroupChild...)} to add - * samplers or controllers, their default assigned weight will be 100. - * @param child is the element to add as controller child that will be selected for execution - * during iterations according to given weight. + * Keep in mind that if you use {@link #children(ThreadGroupChild...)} to add samplers or + * controllers, their default assigned weight will be 100. + * @param child is the element to add as controller child that will be selected for execution + * during iterations according to given weight. * @return the controller for further configuration and usage. */ public DslWeightedSwitchController child(long weight, DslController child) { @@ -71,10 +72,10 @@ public DslWeightedSwitchController child(long weight, DslController child) { * Adds a child to the controller with a configured weight for selecting it in iterations. * * @param weight is the weight to assign to this particular element for execution in iterations. - * Keep in mind that if you use {@link #children(ThreadGroupChild...)} to add - * samplers or controllers, their default assigned weight will be 100. - * @param child is the element to add as controller child that will be selected for execution - * during iterations according to given weight. + * Keep in mind that if you use {@link #children(ThreadGroupChild...)} to add samplers or + * controllers, their default assigned weight will be 100. + * @param child is the element to add as controller child that will be selected for execution + * during iterations according to given weight. * @return the controller for further configuration and usage. */ public DslWeightedSwitchController child(long weight, DslSampler child) { @@ -84,14 +85,17 @@ public DslWeightedSwitchController child(long weight, DslSampler child) { /** * Sets the random choice mode for child elements. *
- * When random choice mode is enabled (randomChoice = true), the controller will select child elements - * randomly, according to their weights. When disabled (randomChoice = false), selection will occur - * sequentially based on weights. + * When random choice mode is enabled (randomChoice = true), the controller will select child + * elements randomly, according to their weights. When disabled (randomChoice = false), selection + * will occur sequentially based on weights. + *
+ * The randomChoice(true) method cannot guarantee that the actual execution percentages of its
+ * child elements will exactly match the expected distribution.
*
* @param randomChoice true - to enable random selection, false - for sequential selection
* @return current controller instance for method chaining
*/
- public DslWeightedSwitchController randomChoice(boolean randomChoice){
+ public DslWeightedSwitchController randomChoice(boolean randomChoice) {
this.isRandomChoice = randomChoice;
return this;
}
@@ -192,7 +196,10 @@ public CodeBuilder(List