private JsonElement serializeAsJson() { JsonObject result = new JsonObject(); result.addProperty("runId", this.runId); result.addProperty("buildId", this.buildId); result.addProperty("hostname", Utils.getHostname()); result.addProperty("nbProcessors", Runtime.getRuntime().availableProcessors()); result.addProperty("freeMemory", Runtime.getRuntime().freeMemory()); result.addProperty("totalMemory", Runtime.getRuntime().totalMemory()); return result; }
private List<Object> serializeAsList() { List<Object> dataCol = new ArrayList<>(); dataCol.add(this.runId); dataCol.add(this.buildId); dataCol.add(Utils.getHostname()); dataCol.add(Runtime.getRuntime().availableProcessors()); dataCol.add(Runtime.getRuntime().freeMemory()); dataCol.add(Runtime.getRuntime().totalMemory()); return dataCol; } }
public void notifyEnd() { String subject = "Process "+processName+" on "+Utils.getHostname()+" finished"; Date endDate = new Date(); String message = "The following process: "+ processName +" launched on "+ Utils.getHostname()+ " the "+ this.launchDate.toString()+" and finished "+endDate.toString()+". " + "It ran for a total time of "+Utils.getDuration(this.launchDate, endDate); for (NotifierEngine engine : this.engines) { engine.notify(subject, message); } } }
private List<Object> serializeAsList() { Date date = new Date(); List<Object> dataCol = new ArrayList<Object>(); dataCol.add(runid); dataCol.add(buildId); dataCol.add(containerId); dataCol.add(Utils.formatCompleteDate(date)); dataCol.add(Utils.formatOnlyDay(date)); dataCol.add(Utils.getHostname()); dataCol.add(status); return dataCol; }
private JsonElement serializeAsJson() { Date date = new Date(); JsonObject result = new JsonObject(); result.addProperty("runId", runid); result.addProperty("buildId", buildId); result.addProperty("containerId", containerId); result.addProperty("dateReproducedBuildStr", Utils.formatCompleteDate(date)); this.addDate(result, "dateReproducedBuild", date); result.addProperty("dayReproducedBuild", Utils.formatOnlyDay(date)); result.addProperty("hostname", Utils.getHostname()); result.addProperty("status", status); return result; }
private List<Object> serializeAsList() { Date now = new Date(); String humanDuration = Utils.getDuration(this.beginDate, now); List<Object> dataCol = new ArrayList<Object>(); dataCol.add(this.runId); dataCol.add(Utils.getHostname()); dataCol.add(Utils.formatOnlyDay(this.beginDate)); dataCol.add(Utils.formatCompleteDate(this.beginDate)); dataCol.add(Utils.formatCompleteDate(now)); dataCol.add(humanDuration); dataCol.add(this.status); dataCol.add(this.nbBuilds); return dataCol; }
private List<Object> serializeAsList(Repository repo, Reason reason, String comment) { List<Object> result = new ArrayList<>(); result.add(Utils.getHostname()); result.add(this.rtScanner.getRunId()); result.add(Utils.formatCompleteDate(new Date())); result.add(repo.getId()); result.add(repo.getSlug()); result.add(reason.name()); result.add(comment); return result; }
private JsonObject serializeAsJson(Repository repo, Reason reason, String comment) { JsonObject result = new JsonObject(); result.addProperty("hostname", Utils.getHostname()); result.addProperty("runId", this.rtScanner.getRunId()); this.addDate(result, "dateBlacklist", new Date()); result.addProperty("dateBlacklistStr", Utils.formatCompleteDate(new Date())); result.addProperty("repoId", repo.getId()); result.addProperty("repoName", repo.getSlug()); result.addProperty("reason", reason.name()); result.addProperty("comment", comment); return result; }
private List<Object> serializeAsList(BuildToBeInspected buildToBeInspected, RepairPatch patch) { Build build = buildToBeInspected.getBuggyBuild(); List<Object> result = new ArrayList<>(); result.add(Utils.formatCompleteDate(new Date())); result.add(buildToBeInspected.getRunId()); result.add(build.getId()); result.add(patch.getToolname()); result.add(patch.getDiff()); result.add(patch.getFilePath()); result.add(Utils.getHostname()); return result; }
private JsonElement serializeAsJson() { JsonObject result = new JsonObject(); Date now = new Date(); String humanDuration = Utils.getDuration(this.beginDate, now); result.addProperty("runId", this.runId); result.addProperty("hostname", Utils.getHostname()); result.addProperty("beginDay", Utils.formatOnlyDay(this.beginDate)); result.addProperty("beginDateStr", Utils.formatCompleteDate(this.beginDate)); this.addDate(result, "beginDate", this.beginDate); result.addProperty("endDateStr", Utils.formatCompleteDate(now)); this.addDate(result, "endDate", now); result.addProperty("duration", humanDuration); result.addProperty("endStatus", this.status); result.addProperty("nbBuilds", this.nbBuilds); return result; }
private JsonElement serializeAsJson(BuildToBeInspected buildToBeInspected, RepairPatch patch) { Build build = buildToBeInspected.getBuggyBuild(); JsonObject data = new JsonObject(); data.addProperty("dateStr", Utils.formatCompleteDate(new Date())); this.addDate(data, "date", new Date()); data.addProperty("runId", buildToBeInspected.getRunId()); data.addProperty("buildId", build.getId()); data.addProperty("toolname", patch.getToolname()); data.addProperty("diff", patch.getDiff()); data.addProperty("filepath", patch.getFilePath()); data.addProperty("hostname", Utils.getHostname()); return data; }
private List<Object> serializeAsList(ProjectInspector inspector) { Map<String, Integer> durations = inspector.getJobStatus().getStepsDurationsInSeconds(); 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(inspector.getBuildToBeInspected().getRunId()); int totalDuration = 0; for (Map.Entry<String, Integer> stringIntegerEntry : durations.entrySet()) { dataCol.add(stringIntegerEntry.getValue()); totalDuration += stringIntegerEntry.getValue(); } dataCol.add(totalDuration); return dataCol; }
private JsonElement serializeAsJson(ProjectInspector inspector) { Map<String, Integer> durations = inspector.getJobStatus().getStepsDurationsInSeconds(); 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("runId", inspector.getBuildToBeInspected().getRunId()); int totalDuration = 0; for (Map.Entry<String, Integer> stepDuration : durations.entrySet()) { result.addProperty(stepDuration.getKey(), stepDuration.getValue()); totalDuration += stepDuration.getValue(); } result.addProperty("totalDuration", totalDuration); return result; }
private List<Object> serializeAsList(Build build) { List<Object> result = new ArrayList<>(); result.add(Utils.getHostname()); result.add(this.rtScanner.getRunId()); result.add(Utils.formatCompleteDate(new Date())); result.add(Utils.formatCompleteDate(build.getFinishedAt())); if (build.getRepository() == null) { result.add("ID="+build.getRepository().getId()); } else { result.add(build.getRepository().getSlug()); } result.add(build.getId()); result.add(build.getState()); return result; }
private List<Object> serializeAsList() { List<Object> dataCol = new ArrayList<Object>(); dataCol.add(Utils.getHostname()); dataCol.add(Utils.formatCompleteDate(this.scanner.getScannerRunningBeginDate())); dataCol.add(Utils.formatCompleteDate(this.scanner.getLookFromDate())); dataCol.add(this.scanner.getTotalRepoNumber()); dataCol.add(this.scanner.getTotalRepoUsingTravis()); dataCol.add(this.scanner.getTotalScannedBuilds()); dataCol.add(this.scanner.getTotalBuildInJava()); dataCol.add(this.scanner.getTotalJavaPassingBuilds()); dataCol.add(this.scanner.getTotalBuildInJavaFailing()); dataCol.add(this.scanner.getTotalBuildInJavaFailingWithFailingTests()); dataCol.add(this.scanner.getTotalPRBuilds()); dataCol.add(Utils.formatOnlyDay(this.scanner.getLookFromDate())); dataCol.add(this.scanner.getScannerDuration()); dataCol.add(this.scanner.getRunId()); return dataCol; }
private JsonObject serializeAsJson(Build build) { JsonObject result = new JsonObject(); result.addProperty("hostname", Utils.getHostname()); result.addProperty("runId", this.rtScanner.getRunId()); this.addDate(result, "dateWatched", new Date()); result.addProperty("dateWatchedStr", Utils.formatCompleteDate(new Date())); this.addDate(result, "dateBuildEnd", build.getFinishedAt()); result.addProperty("dateBuildEndStr", Utils.formatCompleteDate(build.getFinishedAt())); if (build.getRepository() == null) { result.addProperty("repository", "ID="+build.getRepository().getId()); } else { result.addProperty("repository", build.getRepository().getSlug()); } result.addProperty("buildId", build.getId()); result.addProperty("status", build.getState().name()); return result; }
private JsonElement serializeAsJson() { JsonObject result = new JsonObject(); result.addProperty("hostname", Utils.getHostname()); result.addProperty("dateBeginStr", Utils.formatCompleteDate(this.scanner.getScannerRunningBeginDate())); this.addDate(result, "dateBegin", this.scanner.getScannerRunningBeginDate()); result.addProperty("dateLimitStr", Utils.formatCompleteDate(this.scanner.getLookFromDate())); this.addDate(result, "dateLimit", this.scanner.getLookFromDate()); result.addProperty("dayLimit", Utils.formatOnlyDay(this.scanner.getLookFromDate())); result.addProperty("totalRepoNumber", this.scanner.getTotalRepoNumber()); result.addProperty("totalRepoUsingTravis", this.scanner.getTotalRepoUsingTravis()); result.addProperty("totalScannedBuilds", this.scanner.getTotalScannedBuilds()); result.addProperty("totalJavaBuilds", this.scanner.getTotalBuildInJava()); result.addProperty("totalJavaPassingBuilds", this.scanner.getTotalJavaPassingBuilds()); result.addProperty("totalJavaFailingBuilds", this.scanner.getTotalBuildInJavaFailing()); result.addProperty("totalJavaFailingBuildsWithFailingTests", this.scanner.getTotalBuildInJavaFailingWithFailingTests()); result.addProperty("totalPRBuilds", this.scanner.getTotalPRBuilds()); result.addProperty("duration", this.scanner.getScannerDuration()); result.addProperty("runId", this.scanner.getRunId()); return result; }
private List<Object> serializeAsList(ProjectInspector inspector) { JobStatus jobStatus = inspector.getJobStatus(); BuildToBeInspected buildToBeInspected = inspector.getBuildToBeInspected(); Build build = inspector.getBuggyBuild(); String state = getPrettyPrintState(inspector); String realState = StringUtils.join(jobStatus.getStepStatuses(), " -> "); String typeOfFailures = StringUtils.join(jobStatus.getFailureNames(), ",") + ""; List<Object> dataCol = new ArrayList<Object>(); dataCol.add(build.getId() + ""); dataCol.add(build.getRepository().getSlug()); dataCol.add(state); dataCol.add(build.getPullRequestNumber() + ""); dataCol.add(Utils.formatCompleteDate(build.getFinishedAt())); dataCol.add(Utils.formatOnlyDay(build.getFinishedAt())); dataCol.add(realState); dataCol.add(Utils.getHostname()); dataCol.add(Utils.formatCompleteDate(new Date())); dataCol.add(Utils.getTravisUrl(build.getId(), build.getRepository().getSlug())); dataCol.add(typeOfFailures); dataCol.add(buildToBeInspected.getRunId()); return dataCol; }
@Override public void observe(ProjectInspector inspector) { JobStatus status = inspector.getJobStatus(); String subject = "URGENT! Error on buggy build "+inspector.getBuggyBuild().getId()+" on machine "+ Utils.getHostname(); String message = "The following error has been encountered: "; if (status.getFatalError() != null) { message += "\n"+status.getFatalError().toString(); } this.notifyEngines(subject, message); } }
private JsonElement serializeAsJson() { JsonObject result = new JsonObject(); result.addProperty("hostname", Utils.getHostname()); result.addProperty("dateBeginStr", Utils.formatCompleteDate(this.scanner.getScannerRunningBeginDate())); this.addDate(result, "dateBegin", this.scanner.getScannerRunningBeginDate()); result.addProperty("dateEndStr", Utils.formatCompleteDate(this.scanner.getScannerRunningEndDate())); this.addDate(result, "dateEnd", this.scanner.getScannerRunningEndDate()); result.addProperty("duration", this.scanner.getScannerDuration()); result.addProperty("dateLookedFromStr", Utils.formatCompleteDate(this.scanner.getLookFromDate())); this.addDate(result, "dateLookedFrom", this.scanner.getLookFromDate()); result.addProperty("dateLookedToStr", Utils.formatCompleteDate(this.scanner.getLookToDate())); this.addDate(result, "dateLookedTo", this.scanner.getLookToDate()); result.addProperty("totalRepoNumber", this.scanner.getTotalRepoNumber()); result.addProperty("totalRepoUsingTravis", this.scanner.getTotalRepoUsingTravis()); result.addProperty("totalScannedBuilds", this.scanner.getTotalScannedBuilds()); result.addProperty("totalJavaBuilds", this.scanner.getTotalBuildInJava()); result.addProperty("totalJavaPassingBuilds", this.scanner.getTotalJavaPassingBuilds()); result.addProperty("totalJavaFailingBuilds", this.scanner.getTotalBuildInJavaFailing()); result.addProperty("totalJavaFailingBuildsWithFailingTests", this.scanner.getTotalBuildInJavaFailingWithFailingTests()); result.addProperty("totalPRBuilds", this.scanner.getTotalPRBuilds()); result.addProperty("totalFailingAndPassingBuildPairs", this.scanner.getTotalNumberOfFailingAndPassingBuildPairs()); result.addProperty("totalPassingAndPassingBuildPairs", this.scanner.getTotalNumberOfPassingAndPassingBuildPairs()); result.addProperty("totalPairOfBuilds", this.scanner.getTotalNumberOfFailingAndPassingBuildPairs() + this.scanner.getTotalNumberOfPassingAndPassingBuildPairs()); result.addProperty("runId", this.scanner.getRunId()); return result; }