Class PercentController

  • All Implemented Interfaces:
    DslController, DslTestElement, BaseThreadGroup.ThreadGroupChild

    public class PercentController
    extends BaseController<PercentController>
    Allows running only given percent of times given test plan elements.

    Internally this uses JMeter Throughput Controller (which has misleading name) with percent executions option.

    The execution of elements is deterministic, holding execution until percentage is reached. For example, if the percent is 25, the execution of child elements will look like: [skip, skip, skip, run, skip, skip, skip, run, ...].

    Execution of children is always run as an atomic set (each time/iteration either all or none of the children are run).

    Since:
    0.25
    • Field Detail

      • percent

        protected String percent
      • perThread

        protected boolean perThread
    • Method Detail

      • perThread

        public PercentController perThread()
        Specifies to apply percent control per thread instead of shared by all threads.

        This might be useful when a more deterministic behavior is required per thread, and each thread execution has to be controlled, instead of relying on in general threads execution percentage.

        Returns:
        the controller for further configuration or usage.
        Since:
        1.0
      • perThread

        public PercentController perThread​(boolean enable)
        Same as perThread() but allowing to enable or disable it.

        This is helpful when the resolution is taken at runtime.

        Parameters:
        enable - specifies to enable or disable the setting. By default, it is set to false.
        Returns:
        the controller for further configuration or usage.
        Since:
        0.63
        See Also:
        perThread()