use of com.hazelcast.simulator.utils.ThreadSpawner in project hazelcast-simulator by hazelcast.
the class WorkerProcessManager method shutdown.
public void shutdown() {
executorService.shutdown();
ThreadSpawner spawner = new ThreadSpawner("workerJvmManagerShutdown", true);
for (final WorkerProcess workerProcess : new ArrayList<WorkerProcess>(workerProcesses.values())) {
spawner.spawn(new Runnable() {
@Override
public void run() {
shutdown(workerProcess);
}
});
}
spawner.awaitCompletion();
}
use of com.hazelcast.simulator.utils.ThreadSpawner in project hazelcast-simulator by hazelcast.
the class TimeStepRunStrategy method spawnThreads.
private ThreadSpawner spawnThreads(TimeStepRunner[] runners) {
ThreadSpawner spawner = new ThreadSpawner(testContext.getTestId());
for (TimeStepRunner runner : runners) {
String executionGroup = runner.executionGroup;
String name = testContext.getTestId();
if (!executionGroup.equals("")) {
name += "-" + executionGroup;
}
name += "-timestepThread";
spawner.spawn(name, runner);
}
return spawner;
}
use of com.hazelcast.simulator.utils.ThreadSpawner in project hazelcast-simulator by hazelcast.
the class GrowingMapTest method run.
@Run
public void run() {
ThreadSpawner spawner = new ThreadSpawner(name);
for (int i = 0; i < threadCount; i++) {
spawner.spawn(new Worker());
}
spawner.awaitCompletion();
}
use of com.hazelcast.simulator.utils.ThreadSpawner in project hazelcast-simulator by hazelcast.
the class ArtifactCleanTask method cleanRemote.
private void cleanRemote() {
long started = System.nanoTime();
LOGGER.info(format("Cleaning Worker homes of %s machines...", registry.agentCount()));
final String cleanCommand = format("rm -fr hazelcast-simulator-%s/workers/*", getSimulatorVersion());
ThreadSpawner spawner = new ThreadSpawner("clean", true);
for (final AgentData agent : registry.getAgents()) {
spawner.spawn(new Runnable() {
@Override
public void run() {
LOGGER.info(format("Cleaning %s", agent.getPublicAddress()));
bash.ssh(agent.getPublicAddress(), cleanCommand);
}
});
}
spawner.awaitCompletion();
long elapsed = getElapsedSeconds(started);
LOGGER.info(format("Finished cleaning Worker homes of %s machines (%s seconds)", registry.agentCount(), elapsed));
}
use of com.hazelcast.simulator.utils.ThreadSpawner in project hazelcast-simulator by hazelcast.
the class RunTestSuiteTask method runParallel.
private boolean runParallel() {
final AtomicBoolean success = new AtomicBoolean(true);
ThreadSpawner spawner = new ThreadSpawner("runParallel", true);
for (final TestCaseRunner runner : runners) {
spawner.spawn(new Runnable() {
@Override
public void run() {
try {
if (!runner.run()) {
success.set(false);
}
} catch (Exception e) {
throw rethrow(e);
}
}
});
}
spawner.awaitCompletion();
return success.get();
}
Aggregations