Class PerfTestRun
- java.lang.Object
-
- org.camunda.bpm.qa.performance.engine.framework.PerfTestRun
-
- All Implemented Interfaces:
Runnable
,PerfTestRunContext
public class PerfTestRun extends Object implements PerfTestRunContext, Runnable
An individual run of a performance test. Holds all state related to a test run.- Author:
- Daniel Meyer
-
-
Field Summary
Fields Modifier and Type Field Description protected PerfTestStep
currentStep
protected boolean
isStarted
protected Map<String,Object>
runContext
protected long
runEndTime
protected PerfTestRunner
runner
protected long
runStartTime
protected AtomicInteger
state
protected long
stepEndTime
protected long
stepStartTime
-
Fields inherited from interface org.camunda.bpm.qa.performance.engine.framework.PerfTestRunContext
currentContext
-
-
Constructor Summary
Constructors Constructor Description PerfTestRun(PerfTestRunner runner, String runId, PerfTestStep firstStep)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
continueRun()
void
endRun()
PerfTestStep
getCurrentStep()
long
getRunEndTime()
PerfTestRunner
getRunner()
long
getRunStartTime()
long
getStepEndTime()
long
getStepStartTime()
<T> T
getVariable(String name)
boolean
isAlreadySignaled()
Sets the run into waiting state and returns if the run was already signaled.boolean
isWaitingForSignal()
Signals the run and returns if the run was already waiting for a signal.void
logStepResult(Object stepResult)
protected void
notifyWatchersAfterStep()
protected void
notifyWatchersBeforeStep()
protected void
notifyWatchersEndRun()
protected void
notifyWatchersStartRun()
protected void
pauseRun()
void
run()
void
setCurrentStep(PerfTestStep currentStep)
void
setVariable(String name, Object value)
void
startRun()
-
-
-
Field Detail
-
isStarted
protected boolean isStarted
-
runStartTime
protected long runStartTime
-
runEndTime
protected long runEndTime
-
stepStartTime
protected long stepStartTime
-
stepEndTime
protected long stepEndTime
-
currentStep
protected volatile PerfTestStep currentStep
-
state
protected AtomicInteger state
-
runner
protected PerfTestRunner runner
-
-
Constructor Detail
-
PerfTestRun
public PerfTestRun(PerfTestRunner runner, String runId, PerfTestStep firstStep)
-
-
Method Detail
-
startRun
public void startRun()
-
endRun
public void endRun()
-
continueRun
protected void continueRun()
-
pauseRun
protected void pauseRun()
-
getVariable
public <T> T getVariable(String name)
- Specified by:
getVariable
in interfacePerfTestRunContext
-
setVariable
public void setVariable(String name, Object value)
- Specified by:
setVariable
in interfacePerfTestRunContext
-
setCurrentStep
public void setCurrentStep(PerfTestStep currentStep)
-
getRunStartTime
public long getRunStartTime()
-
getRunEndTime
public long getRunEndTime()
-
getCurrentStep
public PerfTestStep getCurrentStep()
-
getRunner
public PerfTestRunner getRunner()
-
getStepEndTime
public long getStepEndTime()
-
getStepStartTime
public long getStepStartTime()
-
isAlreadySignaled
public boolean isAlreadySignaled()
Sets the run into waiting state and returns if the run was already signaled. Note: This method will change the state of the run to waiting.- Returns:
- true if the run was already signaled, false otherwise
-
isWaitingForSignal
public boolean isWaitingForSignal()
Signals the run and returns if the run was already waiting for a signal. Note: This method will change the state of the run to signaled.- Returns:
- true if the run was waiting, false otherwise
-
notifyWatchersStartRun
protected void notifyWatchersStartRun()
-
notifyWatchersEndRun
protected void notifyWatchersEndRun()
-
notifyWatchersBeforeStep
protected void notifyWatchersBeforeStep()
-
notifyWatchersAfterStep
protected void notifyWatchersAfterStep()
-
logStepResult
public void logStepResult(Object stepResult)
-
-