Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -57,7 +57,7 @@ class MultiThreadedRunner implements Callable<Void> {
private final Scenario scenario;
private final WorkloadExecutor workloadExecutor;
private final XMLConfigParser parser;

private final boolean writeRuntimeResults;

/**
* MultiThreadedRunner
Expand All@@ -83,6 +83,7 @@ class MultiThreadedRunner implements Callable<Void> {
this.resultManager = new ResultManager(dataModelResult.getName(), writeRuntimeResults);
this.workloadExecutor = workloadExecutor;
this.parser = parser;
this.writeRuntimeResults = writeRuntimeResults;
}

/**
Expand All@@ -105,16 +106,25 @@ public Void call() throws Exception {
if (!timedQuery(i+1)) {
break;
}
if ((EnvironmentEdgeManager.currentTimeMillis() - lastResultWritten) > 1000) {
if (writeRuntimeResults &&
(EnvironmentEdgeManager.currentTimeMillis() - lastResultWritten) > 1000) {
resultManager.write(dataModelResult, ruleApplier);
lastResultWritten = EnvironmentEdgeManager.currentTimeMillis();
}
}
}

if (!writeRuntimeResults) {
long duration = EnvironmentEdgeManager.currentTimeMillis() - threadStartTime;
LOGGER.info("The read query " + query.getStatement() + " for this thread in ("
+ duration + ") Ms");
}

// Make sure all result have been dumped before exiting
synchronized (workloadExecutor) {
resultManager.flush();
if (writeRuntimeResults) {
synchronized (workloadExecutor) {
resultManager.flush();
}
}

LOGGER.info("\n\nThread exiting." + threadName + "\n\n");
Expand Down