@Nullable public static Metric getMetric(StepExecution stepExecution, Metric.MetricType type) { Metric[] metrics = stepExecution.getMetrics(); for (Metric metric : metrics) { if(metric.getType() == type) { return metric; } } return null; }
public static Metric getMetric(StepExecution stepExecution, Metric.MetricType type) { Metric[] metrics = stepExecution.getMetrics(); for (Metric metric : metrics) { if(metric.getType() == type) { return metric; } } return null; }
assertEquals("persisted data", jsrStepExecution.getPersistentUserData()); Metric[] metrics = jsrStepExecution.getMetrics();
private static Object[] asArray(final StepExecution n) { return new Object[] { n.getStepExecutionId(), n.getStepName(), n.getBatchStatus().name(), n.getExitStatus(), n.getStartTime() != null ? n.getStartTime().toString() : "", n.getEndTime() != null ? n.getEndTime().toString() : "", metric(n.getMetrics(), Metric.MetricType.READ_COUNT), metric(n.getMetrics(), Metric.MetricType.WRITE_COUNT), metric(n.getMetrics(), Metric.MetricType.COMMIT_COUNT), metric(n.getMetrics(), Metric.MetricType.ROLLBACK_COUNT), metric(n.getMetrics(), Metric.MetricType.READ_SKIP_COUNT), metric(n.getMetrics(), Metric.MetricType.PROCESS_SKIP_COUNT), metric(n.getMetrics(), Metric.MetricType.WRITE_SKIP_COUNT), metric(n.getMetrics(), Metric.MetricType.FILTER_COUNT) }; }
stringBuilder.append(CSV_DELIMITER); Metric[] metricsArray = stepExecution.getMetrics(); Map<Metric.MetricType, Metric> sourceMap = new HashMap<Metric.MetricType, Metric>(); for (Metric metric : metricsArray) {
@Override public void execute() throws MojoExecutionException, MojoFailureException { final List<StepExecution> executions = getOrCreateOperator().getStepExecutions(executionId); getLog().info("Step executions for job execution #" + executionId + ":"); for (final StepExecution exec : executions) { getLog().info(" - id = " + exec.getStepExecutionId()); getLog().info(" + step = " + exec.getStepName()); getLog().info(" + batch status = " + exec.getBatchStatus()); getLog().info(" + exit status = " + exec.getExitStatus()); getLog().info(" + start time = " + exec.getStartTime()); getLog().info(" + end time = " + exec.getEndTime()); getLog().info(" + metrics"); if (exec.getMetrics() != null) { for (final Metric m : exec.getMetrics()) { getLog().info(" > " + m.getType().name().replace("COUNT", "").replace("_", " ").toLowerCase(Locale.ENGLISH) + " = " + m.getValue()); } } } } }
public static StepExecutionEntity create(final StepExecution stepExecution) { final StepExecutionEntity result = new StepExecutionEntity(); result.id = stepExecution.getStepExecutionId(); result.name = stepExecution.getStepName(); result.status = stepExecution.getBatchStatus(); result.exitStatus = stepExecution.getExitStatus(); result.endTime = stepExecution.getEndTime(); result.startTime = stepExecution.getStartTime(); // metrics result.metrics = new HashMap<>(); final Metric[] metricArr = stepExecution.getMetrics(); for (Metric m : metricArr) { result.metrics.put(m.getType().name().toLowerCase(), m.getValue()); } if (stepExecution.getPersistentUserData() != null) { result.setPersistentUserData(stepExecution.getPersistentUserData().toString()); } return result; }
stepMetricsIndex = index; Map<String, Long> metricMap = new HashMap<>(); if (stepExecution.getMetrics() != null) { ColumnFormatter cf = new ColumnFormatter(new String[]{"METRICNAME", "VALUE"}); for (Metric metric : stepExecution.getMetrics()) { metricMap.put(metric.getType().name(), metric.getValue()); cf.addRow(new Object[] {metric.getType().name(), metric.getValue()});
final List<StepExecution> steps = persistenceManagerService.getStepExecutionsForJobExecution(subJob.getJobExecutionImpl().getExecutionId()); if (steps.size() == 1) { for (final Metric metric : steps.iterator().next().getMetrics()) { stepContext.getMetric(metric.getType()).incValueBy(metric.getValue());
assertWithMessage("Testing execution #1", BatchStatus.COMPLETED, execution1.getBatchStatus()); Metric[] metrics = step.getMetrics();
execution1.getBatchStatus()); Metric[] metrics = step.getMetrics();
assertWithMessage("Testing execution #1", BatchStatus.COMPLETED, execution1.getBatchStatus()); Metric[] metrics = step.getMetrics();
execution1.getBatchStatus()); Metric[] metrics = step.getMetrics();
execution1.getBatchStatus()); Metric[] metrics = step.getMetrics();
execution1.getBatchStatus()); Metric[] metrics = step.getMetrics();
private void showStepState(StepExecution step) { Reporter.log("---------------------------<p>"); Reporter.log("getJobExecutionId(): " + step.getStepExecutionId() + " - "); Metric[] metrics = step.getMetrics(); for (int i = 0; i < metrics.length; i++) { Reporter.log(metrics[i].getType() + ": " + metrics[i].getValue() + " - "); } Reporter.log("getStartTime(): " + step.getStartTime() + " - "); Reporter.log("getEndTime(): " + step.getEndTime() + " - "); Reporter.log("getBatchStatus(): " + step.getBatchStatus() + " - "); Reporter.log("getExitStatus(): " + step.getExitStatus()); Reporter.log("---------------------------<p>"); }
execution1.getBatchStatus()); Metric[] metrics = step.getMetrics();
private void showStepState(StepExecution step) { Reporter.log("---------------------------<p>"); Reporter.log("getStepName(): " + step.getStepName() + " - "); Reporter.log("getStepExecutionId(): " + step.getStepExecutionId() + " - "); Metric[] metrics = step.getMetrics(); for (int i = 0; i < metrics.length; i++) { Reporter.log(metrics[i].getType() + ": " + metrics[i].getValue() + " - "); } Reporter.log("getStartTime(): " + step.getStartTime() + " - "); Reporter.log("getEndTime(): " + step.getEndTime() + " - "); Reporter.log("getBatchStatus(): " + step.getBatchStatus() + " - "); Reporter.log("getExitStatus(): " + step.getExitStatus()+"<p>"); Reporter.log("---------------------------<p>"); }
private void showStepState(StepExecution step) { Reporter.log("---------------------------"); Reporter.log("getStepName(): " + step.getStepName() + " - "); Reporter.log("getJobExecutionId(): " + step.getStepExecutionId() + " - "); //System.out.print("getStepExecutionId(): " + step.getStepExecutionId() + " - "); Metric[] metrics = step.getMetrics(); for (int i = 0; i < metrics.length; i++) { Reporter.log(metrics[i].getType() + ": " + metrics[i].getValue() + " - "); } Reporter.log("getStartTime(): " + step.getStartTime() + " - "); Reporter.log("getEndTime(): " + step.getEndTime() + " - "); //System.out.print("getLastUpdateTime(): " + step.getLastUpdateTime() + " - "); Reporter.log("getBatchStatus(): " + step.getBatchStatus() + " - "); Reporter.log("getExitStatus(): " + step.getExitStatus()); Reporter.log("---------------------------"); } }