Commit 03c35c2e authored by Daniel Seybold's avatar Daniel Seybold

added proper logging of specs a json

parent bc5a22f5
Pipeline #51860 passed with stage
in 12 minutes and 20 seconds
......@@ -171,6 +171,12 @@
<version>0.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<!-- Workload-API client -->
<dependency>
<groupId>de.uulm.omi.dbms.workload</groupId>
......
......@@ -184,7 +184,7 @@ public class DeployDB extends EvaluationTask {
+ File.separator + EvaluationTask.SPECS_FOLDER
+ File.separator + EvaluationTask.RESOURCE_MAPPING_SPEC;
this.writeReport(specUri, resourceMapping.toString());
this.writeReport(specUri, GSON.toJson(resourceMapping));
}
......@@ -192,7 +192,6 @@ public class DeployDB extends EvaluationTask {
public WorkReport call() {
String loggerPrefix= "RUN " + this.evaluationContext.getRunCounter().intValue() +": ";
......@@ -209,7 +208,7 @@ public class DeployDB extends EvaluationTask {
if(databaseSingle != null && databaseCluster == null){
LOGGER.debug( loggerPrefix + "deploying a single DBMS node...");
this.writeReport(specUri, this.databaseSingle.toString());
this.writeReport(specUri, GSON.toJson(this.databaseSingle));
this.logResourceIdMapping(this.databaseSingle.getDatabaseSeedComponent());
......@@ -220,7 +219,7 @@ public class DeployDB extends EvaluationTask {
}else if(databaseCluster != null && databaseSingle == null){
LOGGER.debug( loggerPrefix + "deploying a DBMS cluster...");
this.writeReport(specUri, this.databaseCluster.toString());
this.writeReport(specUri, GSON.toJson(this.databaseCluster));
this.logResourceIdMapping(this.databaseCluster.getDatabaseSeedComponent().get(0));
result = databaseClient
......
package de.uulm.omi.evaluation.task;
import com.google.gson.Gson;
import de.uulm.omi.cloudiator.dbms.evaluator.model.EvaluationContext;
import de.uulm.omi.utils.EntrypointProperties;
import java.io.IOException;
......@@ -40,6 +41,7 @@ public abstract class EvaluationTask implements Work, ReportService {
public static final String TIMESERIES_FOLDER = "timeseries";
public static final String TASK_LOG_FOLDER = "taskLogs";
public static final Gson GSON = new Gson();
protected final EvaluationContext evaluationContext;
protected final TaskType taskType;
......
......@@ -42,7 +42,7 @@ public class Gibbon extends EvaluationTask {
String specUri = this.evaluationContext.getEvluationRun()
+ File.separator + EvaluationTask.SPECS_FOLDER
+ File.separator + EvaluationTask.GIBBON_SPEC;
this.writeReport(specUri, this.gibbonSpec.toString());
this.writeReport(specUri, GSON.toJson(this.gibbonSpec));
try {
......
......@@ -68,7 +68,7 @@ public class Scale extends EvaluationTask {
String specUri = this.evaluationContext.getEvluationRun()
+ File.separator + EvaluationTask.SPECS_FOLDER
+ File.separator + EvaluationTask.ELASTICITY_SPEC;
this.writeReport(specUri, this.elasticitySpec.toString());
this.writeReport(specUri, GSON.toJson(this.elasticitySpec));
if(elasticitySpec.get(0).getScalingType().equals(ScalingTypeEnum.OUT)){
LOGGER.info(loggerPrefix + " Executing SCALE-OUT as specified!");
......
......@@ -63,7 +63,7 @@ public class TpcCWorkload extends EvaluationTask {
LOGGER.debug(loggerPrefix + "Running Workload Spec: " + tpccWorkload.toString());
String specUri = this.evaluationContext.getEvluationRun() + File.separator + EvaluationTask.SPECS_FOLDER
+ File.separator + EvaluationTask.TRANSACTION_SPEC;
this.writeReport(specUri, tpccWorkload.toString());
this.writeReport(specUri, GSON.toJson(tpccWorkload));
......
......@@ -155,11 +155,14 @@ public class YcsbWorkload extends EvaluationTask {
}
private void writeWorkloadSpec(int instanceCounter, String workloadSpecName){
String ycsbJSON = GSON.toJson(ycsbWorkload);
//Write Spec to disk
LOGGER.debug(loggerPrefix + "Running Workload Spec: " + ycsbWorkload.toString());
LOGGER.debug(loggerPrefix + "Running Workload Spec: " + ycsbJSON);
String specUri = this.evaluationContext.getEvluationRun() + File.separator + EvaluationTask.SPECS_FOLDER
+ File.separator + instanceCounter + "_" + workloadSpecName;
this.writeReport(specUri, ycsbWorkload.toString());
this.writeReport(specUri, ycsbJSON);
}
......
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