public class OpenTsdbMetricWriter extends Object implements MetricWriter
MetricWriter for the Open TSDB database (version 2.0), writing metrics to the
HTTP endpoint provided by the server. Data are buffered according to the
bufferSize property, and only flushed automatically when
the buffer size is reached. Users should either manually flush() after writing
a batch of data if that makes sense, or consider adding a Scheduled task to flush periodically.| Constructor and Description |
|---|
OpenTsdbMetricWriter() |
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Flush the buffer without waiting for it to fill any further.
|
RestOperations |
getRestTemplate() |
void |
increment(Delta<?> delta)
Increment the value of a metric (or decrement if the delta is negative).
|
void |
reset(String metricName)
Reset the value of a metric, usually to zero value.
|
void |
set(Metric<?> value)
Set the value of a metric.
|
void |
setBufferSize(int bufferSize) |
void |
setMediaType(MediaType mediaType) |
void |
setNamingStrategy(OpenTsdbNamingStrategy namingStrategy) |
void |
setRestTemplate(RestOperations restTemplate) |
void |
setUrl(String url) |
public RestOperations getRestTemplate()
public void setRestTemplate(RestOperations restTemplate)
public void setUrl(String url)
public void setBufferSize(int bufferSize)
public void setMediaType(MediaType mediaType)
public void setNamingStrategy(OpenTsdbNamingStrategy namingStrategy)
public void increment(Delta<?> delta)
MetricWriterincrement in interface MetricWriterdelta - the amount to increment bypublic void set(Metric<?> value)
MetricWriterset in interface MetricWritervalue - the valuepublic void flush()
public void reset(String metricName)
MetricWriterreset in interface MetricWritermetricName - the name to resetCopyright © 2015 Pivotal Software, Inc.. All rights reserved.