private double calculatePercentageComplete() { if (isFinished) { percentCompleteBasis = PercentCompleteBasis.ENDTIME; return 1; } if (stepExecutionHistory.getCount() == 0) { percentCompleteBasis = PercentCompleteBasis.NOHISTORY; return 0.5; } CumulativeHistory readHistory = stepExecutionHistory.getReadCount(); if (readHistory.getMean() == 0) { percentCompleteBasis = PercentCompleteBasis.DURATION; return getDurationBasedEstimate(duration); } percentCompleteBasis = PercentCompleteBasis.READCOUNT; return stepExecution.getReadCount() / readHistory.getMean(); }
/** * Compute step execution history for the given jobs step. * * @param jobName the name of the job * @param stepName the name of the step * @return the step execution history for the given step */ private StepExecutionHistory computeHistory(String jobName, String stepName) { int total = jobService.countStepExecutionsForStep(jobName, stepName); StepExecutionHistory stepExecutionHistory = new StepExecutionHistory(stepName); for (int i = 0; i < total; i += 1000) { for (StepExecution stepExecution : jobService.listStepExecutionsForStep(jobName, stepName, i, 1000)) { stepExecutionHistory.append(stepExecution); } } return stepExecutionHistory; }
private double getDurationBasedEstimate(double duration) { CumulativeHistory durationHistory = stepExecutionHistory.getDuration(); if (durationHistory.getMean() == 0) { percentCompleteBasis = PercentCompleteBasis.NOINFORMATION; return 0.5; } return duration / durationHistory.getMean(); }
.addValue(progressInfoResource.getStepExecution().getLastUpdated()); modelBuilder.addRow().addValue("Read Count ") .addValue(progressInfoResource.getStepExecutionHistory().getReadCount().getCount()); modelBuilder.addRow().addValue("Write Count ") .addValue(progressInfoResource.getStepExecutionHistory().getWriteCount().getCount()); modelBuilder.addRow().addValue("Filter Count ") .addValue(progressInfoResource.getStepExecutionHistory().getFilterCount().getCount()); modelBuilder.addRow().addValue("Read Skip Count ") .addValue(progressInfoResource.getStepExecutionHistory().getReadSkipCount().getCount()); modelBuilder.addRow().addValue("Write Skip Count ") .addValue(progressInfoResource.getStepExecutionHistory().getWriteSkipCount().getCount()); modelBuilder.addRow().addValue("Process Skip Count ") .addValue(progressInfoResource.getStepExecutionHistory().getProcessSkipCount().getCount()); modelBuilder.addRow().addValue("Read Skip Count ") .addValue(progressInfoResource.getStepExecutionHistory().getReadSkipCount().getCount()); modelBuilder.addRow().addValue("Commit Count ") .addValue(progressInfoResource.getStepExecutionHistory().getCommitCount().getCount()); modelBuilder.addRow().addValue("Rollback Count ") .addValue(progressInfoResource.getStepExecutionHistory().getRollbackCount().getCount()); modelBuilder.addRow().addValue("Exit Status ") .addValue(progressInfoResource.getStepExecution().getExitStatus().getExitCode());
.addValue(progressInfoResource.getStepExecution().getLastUpdated()); modelBuilder.addRow().addValue("Read Count ") .addValue(progressInfoResource.getStepExecutionHistory().getReadCount().getCount()); modelBuilder.addRow().addValue("Write Count ") .addValue(progressInfoResource.getStepExecutionHistory().getWriteCount().getCount()); modelBuilder.addRow().addValue("Filter Count ") .addValue(progressInfoResource.getStepExecutionHistory().getFilterCount().getCount()); modelBuilder.addRow().addValue("Read Skip Count ") .addValue(progressInfoResource.getStepExecutionHistory().getReadSkipCount().getCount()); modelBuilder.addRow().addValue("Write Skip Count ") .addValue(progressInfoResource.getStepExecutionHistory().getWriteSkipCount().getCount()); modelBuilder.addRow().addValue("Process Skip Count ") .addValue(progressInfoResource.getStepExecutionHistory().getProcessSkipCount().getCount()); modelBuilder.addRow().addValue("Read Skip Count ") .addValue(progressInfoResource.getStepExecutionHistory().getReadSkipCount().getCount()); modelBuilder.addRow().addValue("Commit Count ") .addValue(progressInfoResource.getStepExecutionHistory().getCommitCount().getCount()); modelBuilder.addRow().addValue("Rollback Count ") .addValue(progressInfoResource.getStepExecutionHistory().getRollbackCount().getCount()); modelBuilder.addRow().addValue("Exit Status ") .addValue(progressInfoResource.getStepExecution().getExitStatus().getExitCode());
private double calculatePercentageComplete() { if (isFinished) { percentCompleteBasis = PercentCompleteBasis.ENDTIME; return 1; } if (stepExecutionHistory.getCount() == 0) { percentCompleteBasis = PercentCompleteBasis.NOHISTORY; return 0.5; } CumulativeHistory readHistory = stepExecutionHistory.getReadCount(); if (readHistory.getMean() == 0) { percentCompleteBasis = PercentCompleteBasis.DURATION; return getDurationBasedEstimate(duration); } percentCompleteBasis = PercentCompleteBasis.READCOUNT; return stepExecution.getReadCount() / readHistory.getMean(); }
/** * Compute step execution history for the given jobs step. * * @param jobName the name of the job * @param stepName the name of the step * @return the step execution history for the given step */ private StepExecutionHistory computeHistory(String jobName, String stepName) { int total = jobService.countStepExecutionsForStep(jobName, stepName); StepExecutionHistory stepExecutionHistory = new StepExecutionHistory(stepName); for (int i = 0; i < total; i += 1000) { for (StepExecution stepExecution : jobService.listStepExecutionsForStep(jobName, stepName, i, 1000)) { stepExecutionHistory.append(stepExecution); } } return stepExecutionHistory; }
private double getDurationBasedEstimate(double duration) { CumulativeHistory durationHistory = stepExecutionHistory.getDuration(); if (durationHistory.getMean() == 0) { percentCompleteBasis = PercentCompleteBasis.NOINFORMATION; return 0.5; } return duration / durationHistory.getMean(); }