public class StressTestParallelClientManager extends Object implements ParallelClientManager<StressOptions>
| Constructor and Description |
|---|
StressTestParallelClientManager(Runner<StressOptions> runner,
StressOptions options)
Creates a new Parallel Client Manager
|
| Modifier and Type | Method and Description |
|---|---|
Object |
call() |
int |
completeRun()
Method that will be called by parallel clients to indicate they have
completed a run and to obtain what run completion number it is
|
ParallelClient<StressOptions> |
createClient(int id)
Creates a new parallel client
|
protected boolean |
exceededMaxRuntime()
Gets whether the maximum run time has been exceeded
|
long |
getCurrentClientCount()
Gets the current number of parallel clients in-use
|
StressOptions |
getOptions()
Gets the options
|
Runner<StressOptions> |
getRunner()
Gets the runner
|
void |
halt()
Method called by parallel clients to tell the manager that they
encountered a halting condition and thus all clients should halt
|
boolean |
hasFinished()
Returns whether the parallel clients have finished all necessary runs
|
boolean |
isReady()
Gets whether the manager is ready for clients to begin executing
|
boolean |
shouldRun()
Method that will be called by parallel clients to determine if they
should continue to run, calls to this are thread safe
|
boolean |
startRun()
Method that will be called by parallel clients to indicate they have
started a new run
|
public StressTestParallelClientManager(Runner<StressOptions> runner, StressOptions options)
runner - Benchmark runneroptions - Optionspublic long getCurrentClientCount()
protected boolean exceededMaxRuntime()
public boolean shouldRun()
ParallelClientManagershouldRun in interface ParallelClientManager<StressOptions>public boolean startRun()
ParallelClientManager
A boolean is returned indicating whether the client should actually go
ahead with the run, this is to help avoid race conditions where multiple
threads check ParallelClientManager.shouldRun() to see if they should proceed and then
attempt to start more runs than actually necessary.
startRun in interface ParallelClientManager<StressOptions>public int completeRun()
ParallelClientManagercompleteRun in interface ParallelClientManager<StressOptions>public boolean hasFinished()
ParallelClientManagerhasFinished in interface ParallelClientManager<StressOptions>public void halt()
ParallelClientManagerhalt in interface ParallelClientManager<StressOptions>public boolean isReady()
ParallelClientManagerisReady in interface ParallelClientManager<StressOptions>public Runner<StressOptions> getRunner()
ParallelClientManagergetRunner in interface ParallelClientManager<StressOptions>public StressOptions getOptions()
ParallelClientManagergetOptions in interface ParallelClientManager<StressOptions>public ParallelClient<StressOptions> createClient(int id)
ParallelClientManagercreateClient in interface ParallelClientManager<StressOptions>id - Client IDCopyright © 2014. All Rights Reserved.