use of ai.grakn.GraknSystemProperty in project grakn by graknlabs.
the class BenchmarkTest method newOptionsBuilder.
private ChainedOptionsBuilder newOptionsBuilder() throws Exception {
String className = getClass().getSimpleName();
ChainedOptionsBuilder runnerOptions = new OptionsBuilder().include(".*" + className + ".*").detectJvmArgs();
// We have to pass system properties into the child JVM
// TODO: This should probably not be necessary
List<String> jvmArgs = new ArrayList<>();
for (GraknSystemProperty property : GraknSystemProperty.values()) {
String value = property.value();
if (value != null) {
jvmArgs.add("-D" + property.key() + "=" + value);
}
}
runnerOptions.jvmArgsAppend(jvmArgs.toArray(new String[jvmArgs.size()]));
if (getWarmupIterations() > 0) {
runnerOptions.warmupIterations(getWarmupIterations());
}
if (getMeasureIterations() > 0) {
runnerOptions.measurementIterations(getMeasureIterations());
}
if (getReportDir() != null) {
String filePath = getReportDir() + className + ".json";
File file = new File(filePath);
if (file.exists()) {
file.delete();
} else {
file.getParentFile().mkdirs();
file.createNewFile();
}
runnerOptions.resultFormat(ResultFormatType.JSON);
runnerOptions.result(filePath);
}
return runnerOptions;
}
Aggregations