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 |
GAUGE_PREFIX |
static String |
TIMER_PREFIX |
| Constructor and Description |
|---|
MetricsListener(org.springframework.boot.actuate.metrics.GaugeService gaugeService,
org.springframework.boot.actuate.metrics.rich.RichGaugeReader richGaugeReader,
org.springframework.boot.actuate.metrics.reader.MetricReader metricReader,
List<org.springframework.boot.actuate.metrics.export.Exporter> exporters) |
| 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 GAUGE_PREFIX
public static final String TIMER_PREFIX
public MetricsListener(org.springframework.boot.actuate.metrics.GaugeService gaugeService,
org.springframework.boot.actuate.metrics.rich.RichGaugeReader richGaugeReader,
org.springframework.boot.actuate.metrics.reader.MetricReader metricReader,
List<org.springframework.boot.actuate.metrics.export.Exporter> exporters)
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 © 2016. All Rights Reserved.