C - specifies the type of the class used to interact with the remote engine API.S - specifies the type of test plan stats returned by this engine.public abstract class BaseRemoteEngine<C extends BaseRemoteEngineApiClient,S extends TestPlanStats> extends Object implements DslJmeterEngine
| Constructor and Description |
|---|
BaseRemoteEngine() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract C |
buildClient()
Builds the API client class that is required for interaction with the remote engine service.
|
protected TestStopper |
buildTestStopper() |
protected org.apache.jorphan.collections.HashTree |
buildTree(DslTestPlan testPlan,
BuildTreeContext context) |
protected org.apache.jmeter.threads.ThreadGroup |
extractFirstThreadGroup(org.apache.jorphan.collections.HashTree tree) |
protected List<File> |
findDependencies(org.apache.jorphan.collections.HashTree tree,
BuildTreeContext ctx) |
protected boolean |
hasTimedOut(Duration timeout,
Instant start)
Allows to easily check if a given timeout has expired since a given process start time.
|
protected boolean |
isAutoStoppableTest(org.apache.jorphan.collections.HashTree tree) |
protected String |
prettyDuration(Duration duration)
Formats given duration into a more human friendly string format.
|
TestPlanStats |
run(DslTestPlan testPlan) |
protected abstract S |
run(File jmxFile,
org.apache.jorphan.collections.HashTree tree,
BuildTreeContext context)
Executes the given jmx file (generated from a DSL test plan) in the remote engine service.
|
protected C extends BaseRemoteEngineApiClient apiClient
public TestPlanStats run(DslTestPlan testPlan) throws IOException, InterruptedException, TimeoutException
run in interface DslJmeterEngineIOExceptionInterruptedExceptionTimeoutExceptionprotected abstract S run(File jmxFile, org.apache.jorphan.collections.HashTree tree, BuildTreeContext context) throws IOException, InterruptedException, TimeoutException
This method needs to be implemented by each remote engine containing common setup y resources resolution logic, test plan upload, test execution start, waiting for test execution to end and test plan statistics retrieval after test execution ends.
jmxFile - specifies the temporary file which contains a JMeter test plan generated from a
JMeter DSL test plan.tree - specifies the JMeter tree generated from the JMeter DSL test plan. This is
usually helpful in case some analysis or inspection is required on the test plan
for its remote execution.context - specifies the build context which can be used to get additional information.
Like file assets used by the test plan to upload to the remote engine.IOException - is thrown when there is some communication problem with the remote
engine service.InterruptedException - is thrown when the user has interrupted the execution of the test
plan.TimeoutException - is thrown when test plan is taking more time than expected
executing, or some intermediary phase (test plan validation,
upload, statistics retrieval, etc) takes more than expected.protected abstract C buildClient()
protected TestStopper buildTestStopper()
protected org.apache.jorphan.collections.HashTree buildTree(DslTestPlan testPlan, BuildTreeContext context)
protected List<File> findDependencies(org.apache.jorphan.collections.HashTree tree, BuildTreeContext ctx)
protected boolean isAutoStoppableTest(org.apache.jorphan.collections.HashTree tree)
protected org.apache.jmeter.threads.ThreadGroup extractFirstThreadGroup(org.apache.jorphan.collections.HashTree tree)
protected boolean hasTimedOut(Duration timeout, Instant start)
timeout - specifies the duration after the given start, that defines if the associated
process has timed out or not.start - specifies the instant when the associated process started.Copyright © 2024. All rights reserved.