Class DistributedJmeterEngine

  • All Implemented Interfaces:
    DslJmeterEngine

    public class DistributedJmeterEngine
    extends EmbeddedJmeterEngine
    Allows running a JMeter test plan distributed across multiple machines.

    This engine uses JMeter built-in feature to run tests from one node into remote machines.

    Since:
    0.29
    • Constructor Detail

      • DistributedJmeterEngine

        public DistributedJmeterEngine​(String... hosts)
    • Method Detail

      • localBasePort

        public DistributedJmeterEngine localBasePort​(int basePort)
        Allows setting the initial port number used to calculate rest of ports to establish RMI connections.

        This method allows to have a predefined range of ports to be used, and in consequence, properly configure firewall rules.

        Parameters:
        basePort - the port number to start creating connections from. 1 port is required for each connection to a remote port, and ports will be assigned incrementally from the given value.
        Returns:
        the DistributedJMeterEngine instance for further configuration or usage.
      • stopEnginesOnTestEnd

        public DistributedJmeterEngine stopEnginesOnTestEnd()
        Specifies to stop remote engines once a test is run and finished.
        Returns:
        the DistributedJMeterEngine instance for further configuration or usage.
      • stopEnginesOnTestEnd

        public DistributedJmeterEngine stopEnginesOnTestEnd​(boolean enable)
        Same as stopEnginesOnTestEnd() but allowing to enable or disable it.
        Parameters:
        enable - specifies to enable or disable the setting. By default, it is set to false.
        Returns:
        the DistributedJMeterEngine instance for further configuration or usage.
        Since:
        1.0
        See Also:
        stopEnginesOnTestEnd()
      • run

        public TestPlanStats run​(DslTestPlan testPlan)
                          throws IOException
        Description copied from interface: DslJmeterEngine
        Runs the given test plan obtaining the execution metrics.

        This method blocks execution until the test plan execution ends.

        Specified by:
        run in interface DslJmeterEngine
        Overrides:
        run in class EmbeddedJmeterEngine
        Parameters:
        testPlan - to run in the JMeter engine.
        Returns:
        the metrics associated to the run.
        Throws:
        IOException - when there is a problem with an IO operation.