@CliCommand(value = PROGRESS_STEP_EXECUTION, help = "Get the progress info for the given step execution")
public Table stepExecutionProgress(
@CliOption(mandatory = true, key = { "", "id" }, help = "the id of the step execution") long stepExecutionId,
@CliOption(mandatory = true, key = { "jobExecutionId" }, help = "the job execution id") long jobExecutionId) {
StepExecutionProgressInfoResource progressInfoResource = jobOperations().stepExecutionProgress(jobExecutionId,
stepExecutionId);
Table table = new Table();
table.addHeader(1, new TableHeader("Id"))
.addHeader(2, new TableHeader("Step Name"))
.addHeader(3, new TableHeader("Percentage Complete"))
.addHeader(4, new TableHeader("Duration"));
final TableRow tableRow = new TableRow();
tableRow.addValue(1, String.valueOf(progressInfoResource.getStepExecution().getId()))
.addValue(2, String.valueOf(progressInfoResource.getStepExecution().getStepName()))
.addValue(3, String.format("%.0f%%", progressInfoResource.getPercentageComplete() * 100))
.addValue(4, String.format("%.0f ms", progressInfoResource.getDuration()));
table.getRows().add(tableRow);
return table;
}