mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
OpenTsdbMetricWriter -> OpenTsdbGaugeWriter
This commit is contained in:
parent
db03e8ea50
commit
96fcd49e2e
@ -27,7 +27,6 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.boot.actuate.metrics.Metric;
|
||||
import org.springframework.boot.actuate.metrics.writer.GaugeWriter;
|
||||
import org.springframework.boot.actuate.metrics.writer.MetricWriter;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
@ -37,7 +36,7 @@ import org.springframework.web.client.RestOperations;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* A {@link MetricWriter} for the Open TSDB database (version 2.0), writing metrics to the
|
||||
* A {@link GaugeWriter} for the Open TSDB database (version 2.0), writing metrics to the
|
||||
* HTTP endpoint provided by the server. Data are buffered according to the
|
||||
* {@link #setBufferSize(int) bufferSize} property, and only flushed automatically when
|
||||
* the buffer size is reached. Users should either manually {@link #flush()} after writing
|
||||
@ -48,9 +47,9 @@ import org.springframework.web.client.RestTemplate;
|
||||
* @author Thomas Badie
|
||||
* @since 1.3.0
|
||||
*/
|
||||
public class OpenTsdbMetricWriter implements GaugeWriter {
|
||||
public class OpenTsdbGaugeWriter implements GaugeWriter {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(OpenTsdbMetricWriter.class);
|
||||
private static final Log logger = LogFactory.getLog(OpenTsdbGaugeWriter.class);
|
||||
|
||||
private RestOperations restTemplate = new RestTemplate();
|
||||
|
@ -34,19 +34,19 @@ import static org.mockito.Matchers.anyString;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
/**
|
||||
* Tests for {@link OpenTsdbMetricWriter}.
|
||||
* Tests for {@link OpenTsdbGaugeWriter}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class OpenTsdbMetricWriterTests {
|
||||
public class OpenTsdbGaugeWriterTests {
|
||||
|
||||
private OpenTsdbMetricWriter writer;
|
||||
private OpenTsdbGaugeWriter writer;
|
||||
|
||||
private RestOperations restTemplate = Mockito.mock(RestOperations.class);
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
this.writer = new OpenTsdbMetricWriter();
|
||||
this.writer = new OpenTsdbGaugeWriter();
|
||||
this.writer.setRestTemplate(this.restTemplate);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ package sample.metrics.opentsdb;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.actuate.autoconfigure.ExportMetricWriter;
|
||||
import org.springframework.boot.actuate.metrics.opentsdb.DefaultOpenTsdbNamingStrategy;
|
||||
import org.springframework.boot.actuate.metrics.opentsdb.OpenTsdbMetricWriter;
|
||||
import org.springframework.boot.actuate.metrics.opentsdb.OpenTsdbGaugeWriter;
|
||||
import org.springframework.boot.actuate.metrics.opentsdb.OpenTsdbNamingStrategy;
|
||||
import org.springframework.boot.actuate.metrics.writer.GaugeWriter;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@ -33,7 +33,7 @@ public class SampleOpenTsdbExportApplication {
|
||||
@ConfigurationProperties("metrics.export")
|
||||
@ExportMetricWriter
|
||||
public GaugeWriter openTsdbMetricWriter() {
|
||||
OpenTsdbMetricWriter writer = new OpenTsdbMetricWriter();
|
||||
OpenTsdbGaugeWriter writer = new OpenTsdbGaugeWriter();
|
||||
writer.setNamingStrategy(namingStrategy());
|
||||
return writer;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user