Commit 6a430a62 authored by Daniel Seybold's avatar Daniel Seybold

some fixes

parent 0048f2d9
Pipeline #81142 passed with stage
in 18 minutes
......@@ -23,7 +23,7 @@ public class Runner implements Runnable {
private static final String TSBS_BINARY = "/opt/workloads/tsbs/bin/";
//checking interval for TSBS commands
private final int CHECKING_INTERVAL = 5000;
private final int CHECKING_INTERVAL = 500;
private TSBSWorkload workload;
private String taskId;
......@@ -94,6 +94,7 @@ public class Runner implements Runnable {
}
LOGGER.debug("Phase 2: query generation finished with exit code: " + workloadProcess.getExitCode());
if(workloadProcess.getExitCode() != 0){
LOGGER.error("Phase 3 finished with error exit code " + workloadProcess.getExitCode());
Thread.currentThread().interrupt();
return;
}
......@@ -151,11 +152,13 @@ public class Runner implements Runnable {
LOGGER.debug("Load phase in process...");
Thread.sleep(CHECKING_INTERVAL);
} catch (InterruptedException e) {
LOGGER.error(e.getMessage());
e.printStackTrace();
}
}
LOGGER.debug("Phase 3: load phase finished with exit code: " + workloadProcess.getExitCode());
if(workloadProcess.getExitCode() != 0){
LOGGER.error("Phase 3 finished with error exit code " + workloadProcess.getExitCode());
Thread.currentThread().interrupt();
return;
}
......@@ -166,7 +169,7 @@ public class Runner implements Runnable {
//Execute Queries
String executeQueriesCommand = TSBSCommandBuilder.executeQueriesCommand(TSBS_BINARY, properties.getProperty(WorkloadApiProperties.WORKLOAD_DATA_FOLDER), workload.getDbms(), workload.getTsbsQueryExecution(), workload.getDbEndpoints() );
executeQueriesCommand += " &> " + properties.getProperty(WorkloadApiProperties.WORKLOAD_RESULTS_FOLDER) + TSBS_RESULT_FOLDER + taskId.trim() + ".txt";
LOGGER.debug(loadCommand);
LOGGER.debug(executeQueriesCommand);
/*
commandToLog = executeQueriesCommand + System.getProperty("line.separator");
try {
......@@ -177,12 +180,28 @@ public class Runner implements Runnable {
return;
}
*/
workloadProcess = WorkloadProcess.getInstance();
workloadProcess
.startWorkload(TSBS_BINARY, UNIX_SHELL, UNIX_COMMAND_PARAM, executeQueriesCommand, taskId,
workloadTimestamp);
while (workloadProcess.isRunning()) {
try {
LOGGER.debug("Query phase in process...");
Thread.sleep(CHECKING_INTERVAL);
} catch (InterruptedException e) {
LOGGER.error(e.getMessage());
e.printStackTrace();
}
}
if(workloadProcess.getExitCode() != 0){
LOGGER.error("Phase 4 finished with error exit code " + workloadProcess.getExitCode());
Thread.currentThread().interrupt();
return;
}
LOGGER.debug("Phase 4: query execution finished");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment