Class DistributedJmeterEngine
- java.lang.Object
-
- us.abstracta.jmeter.javadsl.core.engines.EmbeddedJmeterEngine
-
- us.abstracta.jmeter.javadsl.core.engines.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class us.abstracta.jmeter.javadsl.core.engines.EmbeddedJmeterEngine
EmbeddedJmeterEngine.EmbeddedJMeterEngineStopper, EmbeddedJmeterEngine.TestRunner
-
-
Constructor Summary
Constructors Constructor Description DistributedJmeterEngine(String... hosts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddStatsCollector(org.apache.jorphan.collections.HashTree testPlanTree, TestPlanStats stats)protected EmbeddedJmeterEngine.TestRunnerbuildTestRunner(org.apache.jorphan.collections.HashTree testPlanTree, org.apache.jorphan.collections.HashTree rootTree, TestStopper testStopper)protected BaseTestStopperbuildTestStopper()DistributedJmeterEnginelocalBasePort(int basePort)Allows setting the initial port number used to calculate rest of ports to establish RMI connections.protected DistributedJmeterEnginelocalJMeterEnv(JmeterEnvironment env)TestPlanStatsrun(DslTestPlan testPlan)Runs the given test plan obtaining the execution metrics.DistributedJmeterEnginestopEnginesOnTestEnd()Specifies to stop remote engines once a test is run and finished.DistributedJmeterEnginestopEnginesOnTestEnd(boolean enable)Same asstopEnginesOnTestEnd()but allowing to enable or disable it.-
Methods inherited from class us.abstracta.jmeter.javadsl.core.engines.EmbeddedJmeterEngine
awaitAllClosedVisualizers, prop, propertiesFile, runInEnv
-
-
-
-
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 asstopEnginesOnTestEnd()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()
-
localJMeterEnv
@VisibleForTesting protected DistributedJmeterEngine localJMeterEnv(JmeterEnvironment env)
-
run
public TestPlanStats run(DslTestPlan testPlan) throws IOException
Description copied from interface:DslJmeterEngineRuns the given test plan obtaining the execution metrics.This method blocks execution until the test plan execution ends.
- Specified by:
runin interfaceDslJmeterEngine- Overrides:
runin classEmbeddedJmeterEngine- 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.
-
addStatsCollector
protected void addStatsCollector(org.apache.jorphan.collections.HashTree testPlanTree, TestPlanStats stats)- Overrides:
addStatsCollectorin classEmbeddedJmeterEngine
-
buildTestStopper
protected BaseTestStopper buildTestStopper()
- Overrides:
buildTestStopperin classEmbeddedJmeterEngine
-
buildTestRunner
protected EmbeddedJmeterEngine.TestRunner buildTestRunner(org.apache.jorphan.collections.HashTree testPlanTree, org.apache.jorphan.collections.HashTree rootTree, TestStopper testStopper)
- Overrides:
buildTestRunnerin classEmbeddedJmeterEngine
-
-