public class MetricsListener
extends org.springframework.batch.core.listener.StepExecutionListenerSupport
implements org.springframework.core.Ordered, org.springframework.batch.core.JobExecutionListener
MetricsOutputFormatter may be added to the ApplicationContext.
Counters are cumulated over several StepExecutions belonging to one Step in one JobInstance, important for restarted
jobs.| Modifier and Type | Field and Description |
|---|---|
static String |
METRIC_NAME |
| Constructor and Description |
|---|
MetricsListener(io.micrometer.core.instrument.MeterRegistry meterRegistry) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterJob(org.springframework.batch.core.JobExecution jobExecution) |
org.springframework.batch.core.ExitStatus |
afterStep(org.springframework.batch.core.StepExecution stepExecution) |
void |
beforeJob(org.springframework.batch.core.JobExecution jobExecution) |
int |
getOrder() |
void |
setMetricsOutputFormatter(MetricsOutputFormatter metricsOutputFormatter) |
public static final String METRIC_NAME
public MetricsListener(io.micrometer.core.instrument.MeterRegistry meterRegistry)
public void beforeJob(org.springframework.batch.core.JobExecution jobExecution)
beforeJob in interface org.springframework.batch.core.JobExecutionListenerpublic org.springframework.batch.core.ExitStatus afterStep(org.springframework.batch.core.StepExecution stepExecution)
afterStep in interface org.springframework.batch.core.StepExecutionListenerafterStep in class org.springframework.batch.core.listener.StepExecutionListenerSupportpublic void afterJob(org.springframework.batch.core.JobExecution jobExecution)
afterJob in interface org.springframework.batch.core.JobExecutionListenerpublic int getOrder()
getOrder in interface org.springframework.core.Orderedpublic void setMetricsOutputFormatter(MetricsOutputFormatter metricsOutputFormatter)
Copyright © 2018 codecentric AG. All rights reserved.