Search in sources :

Example 1 with ComputeSourceDir

use of fr.inria.spirals.repairnator.process.step.ComputeSourceDir in project repairnator by Spirals-Team.

the class InspectorTimeSerializer method serializeAsJson.

private JsonElement serializeAsJson(ProjectInspector inspector) {
    Map<String, Integer> durations = inspector.getJobStatus().getMetrics().getStepsDurationsInSeconds();
    int clonage = durations.getOrDefault(CloneRepository.class.getSimpleName(), 0);
    int checkoutBuild = durations.getOrDefault(CheckoutBuggyBuild.class.getSimpleName(), 0);
    int buildtime = durations.getOrDefault(BuildProject.class.getSimpleName(), 0);
    int test = durations.getOrDefault(TestProject.class.getSimpleName(), 0);
    int gatherTestInfo = durations.getOrDefault(GatherTestInformation.class.getSimpleName(), 0);
    int push = durations.getOrDefault(PushIncriminatedBuild.class.getSimpleName(), 0);
    int computeClasspath = durations.getOrDefault(ComputeClasspath.class.getSimpleName(), 0);
    int computeSourceDir = durations.getOrDefault(ComputeSourceDir.class.getSimpleName(), 0);
    int repair = durations.getOrDefault(NopolRepair.class.getSimpleName(), 0);
    int dependencyResolution = durations.getOrDefault(ResolveDependency.class.getSimpleName(), 0);
    int totalDuration = clonage + checkoutBuild + buildtime + test + gatherTestInfo + push + computeClasspath + computeSourceDir + repair + dependencyResolution;
    Build build = inspector.getBuggyBuild();
    JsonObject result = new JsonObject();
    result.addProperty("buildId", build.getId());
    result.addProperty("repositoryName", build.getRepository().getSlug());
    result.addProperty("buildReproductionDateStr", Utils.formatCompleteDate(new Date()));
    this.addDate(result, "buildReproductionDate", new Date());
    result.addProperty("hostname", Utils.getHostname());
    result.addProperty("totalDuration", totalDuration);
    result.addProperty("clonage", clonage);
    result.addProperty("checkoutBuild", checkoutBuild);
    result.addProperty("build", buildtime);
    result.addProperty("test", test);
    result.addProperty("gatherTestInfo", gatherTestInfo);
    result.addProperty("push", push);
    result.addProperty("computeClasspath", computeClasspath);
    result.addProperty("computeSourceDir", computeSourceDir);
    result.addProperty("repair", repair);
    result.addProperty("dependendencyResolution", dependencyResolution);
    result.addProperty("runId", inspector.getBuildToBeInspected().getRunId());
    return result;
}
Also used : CheckoutBuggyBuild(fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild) ComputeClasspath(fr.inria.spirals.repairnator.process.step.ComputeClasspath) ResolveDependency(fr.inria.spirals.repairnator.process.step.ResolveDependency) BuildProject(fr.inria.spirals.repairnator.process.step.BuildProject) ComputeSourceDir(fr.inria.spirals.repairnator.process.step.ComputeSourceDir) JsonObject(com.google.gson.JsonObject) Date(java.util.Date) CloneRepository(fr.inria.spirals.repairnator.process.step.CloneRepository) NopolRepair(fr.inria.spirals.repairnator.process.step.NopolRepair) TestProject(fr.inria.spirals.repairnator.process.step.TestProject) GatherTestInformation(fr.inria.spirals.repairnator.process.step.gatherinfo.GatherTestInformation) PushIncriminatedBuild(fr.inria.spirals.repairnator.process.step.push.PushIncriminatedBuild) Build(fr.inria.jtravis.entities.Build) CheckoutBuggyBuild(fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild) PushIncriminatedBuild(fr.inria.spirals.repairnator.process.step.push.PushIncriminatedBuild)

Example 2 with ComputeSourceDir

use of fr.inria.spirals.repairnator.process.step.ComputeSourceDir in project repairnator by Spirals-Team.

the class InspectorTimeSerializer method serializeAsList.

private List<Object> serializeAsList(ProjectInspector inspector) {
    Map<String, Integer> durations = inspector.getJobStatus().getMetrics().getStepsDurationsInSeconds();
    int clonage = durations.getOrDefault(CloneRepository.class.getSimpleName(), 0);
    int checkoutBuild = durations.getOrDefault(CheckoutBuggyBuild.class.getSimpleName(), 0);
    int buildtime = durations.getOrDefault(BuildProject.class.getSimpleName(), 0);
    int test = durations.getOrDefault(TestProject.class.getSimpleName(), 0);
    int gatherTestInfo = durations.getOrDefault(GatherTestInformation.class.getSimpleName(), 0);
    int push = durations.getOrDefault(PushIncriminatedBuild.class.getSimpleName(), 0);
    int computeClasspath = durations.getOrDefault(ComputeClasspath.class.getSimpleName(), 0);
    int computeSourceDir = durations.getOrDefault(ComputeSourceDir.class.getSimpleName(), 0);
    int repair = durations.getOrDefault(NopolRepair.class.getSimpleName(), 0);
    int dependencyResolution = durations.getOrDefault(ResolveDependency.class.getSimpleName(), 0);
    int totalDuration = clonage + checkoutBuild + buildtime + test + gatherTestInfo + push + computeClasspath + computeSourceDir + repair + dependencyResolution;
    Build build = inspector.getBuggyBuild();
    List<Object> dataCol = new ArrayList<Object>();
    dataCol.add(build.getId() + "");
    dataCol.add(build.getRepository().getSlug());
    dataCol.add(Utils.formatCompleteDate(new Date()));
    dataCol.add(Utils.getHostname());
    dataCol.add(totalDuration);
    dataCol.add(clonage);
    dataCol.add(checkoutBuild);
    dataCol.add(buildtime);
    dataCol.add(test);
    dataCol.add(gatherTestInfo);
    dataCol.add(push);
    dataCol.add(computeClasspath);
    dataCol.add(computeSourceDir);
    dataCol.add(repair);
    dataCol.add(inspector.getBuildToBeInspected().getRunId());
    dataCol.add(dependencyResolution);
    return dataCol;
}
Also used : CheckoutBuggyBuild(fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild) ComputeClasspath(fr.inria.spirals.repairnator.process.step.ComputeClasspath) ResolveDependency(fr.inria.spirals.repairnator.process.step.ResolveDependency) BuildProject(fr.inria.spirals.repairnator.process.step.BuildProject) ComputeSourceDir(fr.inria.spirals.repairnator.process.step.ComputeSourceDir) ArrayList(java.util.ArrayList) Date(java.util.Date) CloneRepository(fr.inria.spirals.repairnator.process.step.CloneRepository) NopolRepair(fr.inria.spirals.repairnator.process.step.NopolRepair) TestProject(fr.inria.spirals.repairnator.process.step.TestProject) GatherTestInformation(fr.inria.spirals.repairnator.process.step.gatherinfo.GatherTestInformation) PushIncriminatedBuild(fr.inria.spirals.repairnator.process.step.push.PushIncriminatedBuild) Build(fr.inria.jtravis.entities.Build) CheckoutBuggyBuild(fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild) PushIncriminatedBuild(fr.inria.spirals.repairnator.process.step.push.PushIncriminatedBuild) JsonObject(com.google.gson.JsonObject)

Aggregations

JsonObject (com.google.gson.JsonObject)2 Build (fr.inria.jtravis.entities.Build)2 BuildProject (fr.inria.spirals.repairnator.process.step.BuildProject)2 CloneRepository (fr.inria.spirals.repairnator.process.step.CloneRepository)2 ComputeClasspath (fr.inria.spirals.repairnator.process.step.ComputeClasspath)2 ComputeSourceDir (fr.inria.spirals.repairnator.process.step.ComputeSourceDir)2 NopolRepair (fr.inria.spirals.repairnator.process.step.NopolRepair)2 ResolveDependency (fr.inria.spirals.repairnator.process.step.ResolveDependency)2 TestProject (fr.inria.spirals.repairnator.process.step.TestProject)2 CheckoutBuggyBuild (fr.inria.spirals.repairnator.process.step.checkoutrepository.CheckoutBuggyBuild)2 GatherTestInformation (fr.inria.spirals.repairnator.process.step.gatherinfo.GatherTestInformation)2 PushIncriminatedBuild (fr.inria.spirals.repairnator.process.step.push.PushIncriminatedBuild)2 Date (java.util.Date)2 ArrayList (java.util.ArrayList)1