Polish
This commit is contained in:
@@ -79,23 +79,17 @@ public class MetricExportAutoConfiguration {
|
||||
reader = new CompositeMetricReader(
|
||||
this.readers.toArray(new MetricReader[this.readers.size()]));
|
||||
}
|
||||
MetricExporters exporters = null;
|
||||
if (reader == null && this.exporters.isEmpty()) {
|
||||
return new NoOpSchedulingConfigurer();
|
||||
}
|
||||
MetricExporters exporters = new MetricExporters(this.properties);
|
||||
if (reader != null) {
|
||||
exporters = new MetricExporters(this.properties);
|
||||
writers.putAll(this.writers);
|
||||
exporters.setReader(reader);
|
||||
exporters.setWriters(writers);
|
||||
}
|
||||
if (!this.exporters.isEmpty()) {
|
||||
if (exporters==null) {
|
||||
exporters = new MetricExporters(this.properties);
|
||||
}
|
||||
exporters.setExporters(this.exporters);
|
||||
}
|
||||
if (exporters!=null) {
|
||||
return exporters;
|
||||
}
|
||||
return new NoOpSchedulingConfigurer();
|
||||
exporters.setExporters(this.exporters);
|
||||
return exporters;
|
||||
}
|
||||
|
||||
@Configuration
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
|
||||
package org.springframework.boot.actuate.metrics.export;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
@@ -29,6 +26,9 @@ import org.springframework.boot.actuate.metrics.reader.MetricReader;
|
||||
import org.springframework.boot.actuate.metrics.writer.MetricWriter;
|
||||
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
/**
|
||||
* Tests for {@link MetricExporters}.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user