use of de.dagere.peass.measurement.utils.RunCommandWriterRCA in project peass by DaGeRe.
the class ExperimentSelector method selectForProject.
private void selectForProject(final File currentPropertyFile, final File currentChangeFile) throws IOException, JsonParseException, JsonMappingException, FileNotFoundException {
final RepoFolders repoFolders = new RepoFolders();
final VersionChangeProperties properties = Constants.OBJECTMAPPER.readValue(currentPropertyFile, VersionChangeProperties.class);
final ProjectChanges changes;
if (currentChangeFile != null && currentChangeFile.exists()) {
changes = Constants.OBJECTMAPPER.readValue(currentChangeFile, ProjectChanges.class);
} else {
changes = null;
}
final String projectName = currentChangeFile != null ? currentChangeFile.getName().replace(".json", "") : currentPropertyFile.getParentFile().getName();
final File fileSlurm = new File(repoFolders.getRCAScriptFolder(), "rca-slurm-" + projectName + ".sh");
final File fileJava = new File(repoFolders.getRCAScriptFolder(), "rca-java-" + projectName + ".sh");
final ExecutionData executionData = repoFolders.getExecutionData(projectName);
final RunCommandWriter writerSlurm = new RunCommandWriterSlurm(new PrintStream(fileSlurm), "cause1", executionData, RunCommandWriterSlurm.EXECUTE_RCA);
final RunCommandWriter writer = new RunCommandWriterRCA(new PrintStream(fileJava), "cause1", executionData);
properties.executeProcessor((version, testcase, change, changeProperties) -> {
all++;
});
if (changes != null) {
changes.executeProcessor((version, testcase, change) -> {
measurementAll++;
});
} else {
printOnlyChanged = false;
}
writeExecutions(properties, changes, writerSlurm, writer);
System.out.println("All: " + executionData.getAllExecutions());
System.out.println("All: " + all + " No testchange: " + noTestchange + " Measurement change: " + measurementChange + " All: " + measurementAll);
}
use of de.dagere.peass.measurement.utils.RunCommandWriterRCA in project peass by DaGeRe.
the class GetChanges method createReader.
private ChangeReader createReader(final ResultsFolders resultsFolders, final SelectedTests selectedTests) throws FileNotFoundException {
RunCommandWriterRCA runCommandWriter = null;
RunCommandWriterSlurmRCA runCommandWriterSlurm = null;
if (selectedTests.getUrl() != null && !selectedTests.getUrl().isEmpty()) {
final PrintStream runCommandPrinter = new PrintStream(new File(resultsFolders.getStatisticsFile().getParentFile(), "run-rca-" + selectedTests.getName() + ".sh"));
runCommandWriter = new RunCommandWriterRCA(runCommandPrinter, "default", selectedTests);
final PrintStream runCommandPrinterRCA = new PrintStream(new File(resultsFolders.getStatisticsFile().getParentFile(), "run-rca-slurm-" + selectedTests.getName() + ".sh"));
runCommandWriterSlurm = new RunCommandWriterSlurmRCA(runCommandPrinterRCA, "default", selectedTests);
}
final ChangeReader reader = new ChangeReader(resultsFolders, runCommandWriter, runCommandWriterSlurm, selectedTests);
reader.setConfig(statisticConfigMixin.getStasticsConfig());
return reader;
}
use of de.dagere.peass.measurement.utils.RunCommandWriterRCA in project peass by DaGeRe.
the class FindChangeExecutions method findProjectExecutions.
public static void findProjectExecutions(final File reexecuteFolder, final String project, final File projectChangeFile, final File executionFile) throws FileNotFoundException, JAXBException, IOException, JsonParseException, JsonMappingException {
System.out.println("Reading: " + project);
final File reexecuteProject = new File(reexecuteFolder, "reexecute-change-" + project + ".sh");
final PrintStream goal = new PrintStream(new FileOutputStream(reexecuteProject));
final ExecutionData executions = Constants.OBJECTMAPPER.readValue(executionFile, ExecutionData.class);
// RunCommandWriter writer = new RunCommandWriterSlurm(goal, NAME, dependencies);
final RunCommandWriter writer = new RunCommandWriterRCA(goal, NAME, executions);
writer.setNice(1000);
writeExecutions(projectChangeFile, executions, writer);
}
Aggregations