Commit 96fcd49e authored by Dave Syer's avatar Dave Syer

OpenTsdbMetricWriter -> OpenTsdbGaugeWriter

parent db03e8ea
...@@ -27,7 +27,6 @@ import org.apache.commons.logging.LogFactory; ...@@ -27,7 +27,6 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.boot.actuate.metrics.Metric; import org.springframework.boot.actuate.metrics.Metric;
import org.springframework.boot.actuate.metrics.writer.GaugeWriter; 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.HttpEntity;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -37,7 +36,7 @@ import org.springframework.web.client.RestOperations; ...@@ -37,7 +36,7 @@ import org.springframework.web.client.RestOperations;
import org.springframework.web.client.RestTemplate; 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 * HTTP endpoint provided by the server. Data are buffered according to the
* {@link #setBufferSize(int) bufferSize} property, and only flushed automatically when * {@link #setBufferSize(int) bufferSize} property, and only flushed automatically when
* the buffer size is reached. Users should either manually {@link #flush()} after writing * the buffer size is reached. Users should either manually {@link #flush()} after writing
...@@ -48,9 +47,9 @@ import org.springframework.web.client.RestTemplate; ...@@ -48,9 +47,9 @@ import org.springframework.web.client.RestTemplate;
* @author Thomas Badie * @author Thomas Badie
* @since 1.3.0 * @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(); private RestOperations restTemplate = new RestTemplate();
......
...@@ -34,19 +34,19 @@ import static org.mockito.Matchers.anyString; ...@@ -34,19 +34,19 @@ import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
/** /**
* Tests for {@link OpenTsdbMetricWriter}. * Tests for {@link OpenTsdbGaugeWriter}.
* *
* @author Dave Syer * @author Dave Syer
*/ */
public class OpenTsdbMetricWriterTests { public class OpenTsdbGaugeWriterTests {
private OpenTsdbMetricWriter writer; private OpenTsdbGaugeWriter writer;
private RestOperations restTemplate = Mockito.mock(RestOperations.class); private RestOperations restTemplate = Mockito.mock(RestOperations.class);
@Before @Before
public void init() { public void init() {
this.writer = new OpenTsdbMetricWriter(); this.writer = new OpenTsdbGaugeWriter();
this.writer.setRestTemplate(this.restTemplate); this.writer.setRestTemplate(this.restTemplate);
} }
......
...@@ -19,7 +19,7 @@ package sample.metrics.opentsdb; ...@@ -19,7 +19,7 @@ package sample.metrics.opentsdb;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.autoconfigure.ExportMetricWriter; import org.springframework.boot.actuate.autoconfigure.ExportMetricWriter;
import org.springframework.boot.actuate.metrics.opentsdb.DefaultOpenTsdbNamingStrategy; 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.opentsdb.OpenTsdbNamingStrategy;
import org.springframework.boot.actuate.metrics.writer.GaugeWriter; import org.springframework.boot.actuate.metrics.writer.GaugeWriter;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
...@@ -33,7 +33,7 @@ public class SampleOpenTsdbExportApplication { ...@@ -33,7 +33,7 @@ public class SampleOpenTsdbExportApplication {
@ConfigurationProperties("metrics.export") @ConfigurationProperties("metrics.export")
@ExportMetricWriter @ExportMetricWriter
public GaugeWriter openTsdbMetricWriter() { public GaugeWriter openTsdbMetricWriter() {
OpenTsdbMetricWriter writer = new OpenTsdbMetricWriter(); OpenTsdbGaugeWriter writer = new OpenTsdbGaugeWriter();
writer.setNamingStrategy(namingStrategy()); writer.setNamingStrategy(namingStrategy());
return writer; return writer;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment