private void echoTestSuiteEnd(int testCount, long started) { LOGGER.info(HORIZONTAL_RULER); if (testCount == 1) { LOGGER.info(format("Finished running of test (%s)", secondsToHuman(getElapsedSeconds(started)))); } else { LOGGER.info(format("Finished running of %d tests (%s)", testCount, secondsToHuman(getElapsedSeconds(started)))); } LOGGER.info(HORIZONTAL_RULER); }
private void echoStartComplete() { long elapsedSeconds = getElapsedSeconds(started); LOGGER.info(HORIZONTAL_RULER); LOGGER.info(format("Finished starting of %s Worker JVMs (%s seconds)", count(memberDeploymentPlan) + count(clientDeploymentPlan), elapsedSeconds)); LOGGER.info(HORIZONTAL_RULER); }
private void waitForWorkerShutdown(int expectedWorkerCount) { int timeoutSeconds = simulatorProperties.getWaitForWorkerShutdownTimeoutSeconds(); long started = System.nanoTime(); LOGGER.info(format("Waiting up to %d seconds for shutdown of %d Workers...", timeoutSeconds, expectedWorkerCount)); long expirationTimeMillis = System.currentTimeMillis() + SECONDS.toMillis(timeoutSeconds); while (componentRegistry.workerCount() > 0 && System.currentTimeMillis() < expirationTimeMillis) { sleepMillis(FINISHED_WORKERS_SLEEP_MILLIS); } List<WorkerData> remainingWorkers = componentRegistry.getWorkers(); if (remainingWorkers.isEmpty()) { LOGGER.info(format("Finished shutdown of all Workers (%d seconds)", getElapsedSeconds(started))); } else { LOGGER.warn(format("Aborted waiting for shutdown of all Workers (%d still running)...", remainingWorkers.size())); LOGGER.warn(format("Unfinished workers: %s", toString(remainingWorkers))); } }
private void cleanRemote() { long started = System.nanoTime(); LOGGER.info(format("Cleaning Worker homes of %s machines...", componentRegistry.agentCount())); final String cleanCommand = format("rm -fr hazelcast-simulator-%s/workers/*", getSimulatorVersion()); ThreadSpawner spawner = new ThreadSpawner("clean", true); for (final AgentData agentData : componentRegistry.getAgents()) { spawner.spawn(new Runnable() { @Override public void run() { LOGGER.info(format("Cleaning %s", agentData.getPublicAddress())); bash.ssh(agentData.getPublicAddress(), cleanCommand); } }); } spawner.awaitCompletion(); long elapsed = getElapsedSeconds(started); LOGGER.info(format("Finished cleaning Worker homes of %s machines (%s seconds)", componentRegistry.agentCount(), elapsed)); } }
private void downloadRemote() { long started = System.nanoTime(); LOGGER.info(format("Download artifacts of %s machines...", componentRegistry.agentCount())); ThreadSpawner spawner = new ThreadSpawner("download", true); for (AgentData agentData : componentRegistry.getAgents()) { spawner.spawn(new DownloadWorkerLogs(agentData.getPublicAddress())); } spawner.spawn(new DownloadAgentLogs()); spawner.awaitCompletion(); long elapsed = getElapsedSeconds(started); LOGGER.info(format("Finished downloading artifacts of %s machines (%s seconds)", componentRegistry.agentCount(), elapsed)); }
private void logMissingWorkers(TestPhase testPhase, int completedWorkers, int expectedWorkers, long started) { long elapsed = getElapsedSeconds(started); if (elapsed % WAIT_FOR_PHASE_COMPLETION_LOG_INTERVAL_SECONDS != 0) { return; } if (elapsed < WAIT_FOR_PHASE_COMPLETION_LOG_VERBOSE_DELAY_SECONDS || completedWorkers == expectedWorkers) { echo(format("Waiting %s for %s completion (%d/%d workers)", secondsToHuman(elapsed), testPhase.desc(), completedWorkers, expectedWorkers)); return; } // verbose logging of missing workers List<SimulatorAddress> missingWorkers = new ArrayList<SimulatorAddress>(expectedWorkers - completedWorkers); if (expectedWorkers == 1) { missingWorkers.add(componentRegistry.getFirstWorker().getAddress()); } else { for (WorkerData worker : componentRegistry.getWorkers()) { if (!phaseCompletedMap.get(testPhase).contains(worker.getAddress())) { missingWorkers.add(worker.getAddress()); } } } echo(format("Waiting %s for %s completion (%d/%d workers) (missing workers: %s)", secondsToHuman(elapsed), testPhase.desc(), completedWorkers, expectedWorkers, missingWorkers)); }
void installSimulator() { ensureIsRemoteSetup(properties, "install"); long started = System.nanoTime(); echoImportant("Installing Simulator on %d machines...", componentRegistry.agentCount()); ThreadSpawner spawner = new ThreadSpawner("installSimulator", true); for (final AgentData agentData : componentRegistry.getAgents()) { spawner.spawn(new Runnable() { @Override public void run() { echo("Installing Simulator on %s", agentData.getPublicAddress()); uploadJARs(agentData.getPublicAddress()); } }); } spawner.awaitCompletion(); long elapsed = getElapsedSeconds(started); echoImportant("Finished installing Simulator on %d machines (%s seconds)", componentRegistry.agentCount(), elapsed); }
void killJavaProcesses() { ensureIsRemoteSetup(properties, "kill"); long started = System.nanoTime(); echoImportant("Killing %s Java processes...", componentRegistry.agentCount()); ThreadSpawner spawner = new ThreadSpawner("killJavaProcesses", true); for (final AgentData agentData : componentRegistry.getAgents()) { spawner.spawn(new Runnable() { @Override public void run() { echo("Killing Java processes on %s", agentData.getPublicAddress()); bash.killAllJavaProcesses(agentData.getPublicAddress()); } }); } spawner.awaitCompletion(); long elapsed = getElapsedSeconds(started); echoImportant("Successfully killed %s Java processes (%s seconds)", componentRegistry.agentCount(), elapsed); }
void installJava() { ensureIsRemoteSetup(properties, "installJava"); long started = System.nanoTime(); echoImportant("Installing JAVA on %d machines...", componentRegistry.agentCount()); ThreadSpawner spawner = new ThreadSpawner("installJava", true); for (final AgentData agentData : componentRegistry.getAgents()) { spawner.spawn(new Runnable() { @Override public void run() { echo("Installing JAVA on %s", agentData.getPublicAddress()); uploadJava(agentData.getPublicAddress()); } }); } spawner.awaitCompletion(); long elapsed = getElapsedSeconds(started); echoImportant("Finished installing JAVA on %d machines (%s seconds)", componentRegistry.agentCount(), elapsed); }
AgentsFile.save(agentsFile, componentRegistry); long elapsed = getElapsedSeconds(started); echoImportant("Terminated %s of %s machines (%s remaining) (%s seconds)", destroyedCount, count, componentRegistry.agentCount(), elapsed);
sleepSeconds(machineWarmupSeconds); long elapsed = getElapsedSeconds(started); echoImportant("Successfully provisioned %s %s machines (%s seconds)", delta, properties.getCloudProvider(), elapsed);