类 OpenTsdbGaugeWriter
- java.lang.Object
- org.springframework.boot.actuate.metrics.opentsdb.OpenTsdbGaugeWriter
- 所有已实现的接口:
GaugeWriter
public class OpenTsdbGaugeWriter extends Object implements GaugeWriter
AGaugeWriter
for the Open TSDB database (version 2.0), writing metrics to the HTTP endpoint provided by the server. Data are buffered according to thebufferSize
property, and only flushed automatically when the buffer size is reached. Users should either manuallyflush()
after writing a batch of data if that makes sense, or consider adding aScheduled
task to flush periodically.- 从以下版本开始:
- 1.3.0
构造器概要
构造器 构造器 说明 OpenTsdbGaugeWriter()
Creates a newOpenTsdbGaugeWriter
with the default connect (10 seconds) and read (30 seconds) timeouts.OpenTsdbGaugeWriter(int connectTimeout, int readTimeout)
Creates a newOpenTsdbGaugeWriter
with the given millisecondconnectTimeout
andreadTimeout
.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
flush()
Flush the buffer without waiting for it to fill any further.org.springframework.web.client.RestOperations
getRestTemplate()
void
set(Metric<?> value)
Set the value of a metric.void
setBufferSize(int bufferSize)
void
setMediaType(org.springframework.http.MediaType mediaType)
void
setNamingStrategy(OpenTsdbNamingStrategy namingStrategy)
void
setRestTemplate(org.springframework.web.client.RestOperations restTemplate)
void
setUrl(String url)
构造器详细资料
OpenTsdbGaugeWriter
public OpenTsdbGaugeWriter()
Creates a newOpenTsdbGaugeWriter
with the default connect (10 seconds) and read (30 seconds) timeouts.
OpenTsdbGaugeWriter
public OpenTsdbGaugeWriter(int connectTimeout, int readTimeout)
Creates a newOpenTsdbGaugeWriter
with the given millisecondconnectTimeout
andreadTimeout
.- 参数:
connectTimeout
- the connect timeout in millisecondsreadTimeout
- the read timeout in milliseconds
方法详细资料
getRestTemplate
public org.springframework.web.client.RestOperations getRestTemplate()
setRestTemplate
public void setRestTemplate(org.springframework.web.client.RestOperations restTemplate)
setBufferSize
public void setBufferSize(int bufferSize)
setMediaType
public void setMediaType(org.springframework.http.MediaType mediaType)
setNamingStrategy
public void setNamingStrategy(OpenTsdbNamingStrategy namingStrategy)
set
public void set(Metric<?> value)
从接口复制的说明:GaugeWriter
Set the value of a metric.- 指定者:
set
在接口中GaugeWriter
- 参数:
value
- the value
flush
public void flush()
Flush the buffer without waiting for it to fill any further.