Commit c680dc5b authored by Julia Abramenko's avatar Julia Abramenko

- modified loading phase (without binary)

- modified query execution (with binary)
parent c79548b8
Pipeline #60536 failed with stage
in 9 minutes and 18 seconds
......@@ -45,7 +45,8 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
//TSBS constants
private final String TSBS_RESULT_FOLDER = "/tmp/"; // TODO CHANGE
private static final String TSBS_BINARY = "/opt/workload/";
private static final String TSBS_BINARY = "/opt/workloads/tsbs/bin/";
private static final String TSBS_SCRIPTS = "/opt/workloads/tsbs/src/github.com/timescale/tsbs/scripts/";
......@@ -172,26 +173,31 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
String resultFileName =
//properties.getProperty(WorkloadApiProperties.WORKLOAD_RESULTS_FOLDER) +
TSBS_RESULT_FOLDER
+ taskId + "-" + workload.getTsbsDataConfig().getFormat() + "-data.gz";
generateDataCommand += "| gzip > " + resultFileName;
//+ taskId + "-"
+ workload.getTsbsDataConfig().getFormat() + "-data.gz";
generateDataCommand += " | gzip > " + resultFileName;
ProcessBuilder genDataProcess= new ProcessBuilder();
genDataProcess.command(UNIX_SHELL, UNIX_COMMAND_PARAM, generateDataCommand);
Process processData = genDataProcess.start();
System.out.println(generateDataCommand);
while (processData.isAlive()) {
Thread.sleep(1000);
}
System.out.println("finished data generation");
String fileToLoad = TSBS_RESULT_FOLDER + taskId + "-"+ workload.getTsbsDataConfig().getFormat() + "-data.gz";
String queriesToExecute = TSBS_RESULT_FOLDER + taskId + "-" + workload.getTsbsDataConfig().getFormat() + "-" + workload.getTsbsQueryConfig().getQueryType() + ".gz";
String fileToLoad = TSBS_RESULT_FOLDER /*+ taskId + "-"*/ + workload.getTsbsDataConfig().getFormat() + "-data.gz";
String queriesToExecute = TSBS_RESULT_FOLDER /*+ taskId + "-" + workload.getTsbsDataConfig().getFormat() + "-" + */ + workload.getTsbsQueryConfig().getQueryType() + ".gz";
//Generate Queries
String generateQueriesCommand = "";
generateQueriesCommand = TSBSCommandBuilder.generateQueries(workload.getTsbsQueryConfig());
String resultQueriesName =
TSBS_RESULT_FOLDER
+ taskId + "-" + workload.getTsbsQueryConfig().getQueryType() + ".gz";
//+ taskId + "-"
+ workload.getTsbsQueryConfig().getQueryType() + ".gz";
generateQueriesCommand += "| gzip > " + resultQueriesName;
System.out.println(generateQueriesCommand);
ProcessBuilder genQueryProcess = new ProcessBuilder();
genQueryProcess.command(UNIX_SHELL, UNIX_COMMAND_PARAM, generateQueriesCommand);
Process processGenQueries = genQueryProcess.start();
......@@ -202,8 +208,10 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
// Benchmarking insert/write performance
String loadCommand = "";
loadCommand = TSBSCommandBuilder.loadCommand(workload.getTsbsDataConfig(), workload.getTsbsLoadConfig(), fileToLoad);
loadCommand += " > " + TSBS_RESULT_FOLDER + taskId + "_load_metrics.csv";
loadCommand = TSBSCommandBuilder.measurePerformance(workload.getTsbsDataConfig(), workload.getTsbsLoadConfig(), TSBS_RESULT_FOLDER, TSBS_SCRIPTS);
loadCommand += " > " + TSBS_RESULT_FOLDER //+ taskId + "_"
+ "load_metrics.csv";
System.out.println(loadCommand);
ProcessBuilder loadProcess = new ProcessBuilder();
loadProcess.command(UNIX_SHELL, UNIX_COMMAND_PARAM, loadCommand);
Process processLoad = loadProcess.start();
......@@ -213,8 +221,10 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
System.out.println("finished loading");
// Execute Queries
String exeQueries = "cat " + queriesToExecute + " | gunzip > | ";
String exeQueries = "cat " + queriesToExecute + " | gunzip | ";
exeQueries += TSBSCommandBuilder.executeQueries(workload.getTsbsDataConfig(), workload.getTsbsQueryExecution(), queriesToExecute);
exeQueries += " > " + TSBS_RESULT_FOLDER + "query_execution.csv";
System.out.println(exeQueries);
workloadProcess
.startWorkload(TSBS_BINARY, UNIX_SHELL, UNIX_COMMAND_PARAM, exeQueries, taskId,
workloadTimestamp);
......
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