public class ElasticReporterConfig extends Object
| Constructor and Description |
|---|
ElasticReporterConfig() |
| Modifier and Type | Method and Description |
|---|---|
ElasticReporterConfig |
addTag(String key,
String value)
Add a name value pair to include in each metric entry.
|
okhttp3.OkHttpClient |
getClient()
Return the client to use (If null one will be created).
|
int |
getConnectTimeout()
Return the connect timeout in seconds.
|
String |
getDirectory()
Return the directory to put metrics into when they fail to be sent at report time.
|
String |
getIndexPrefix()
Return the index name prefix (defaults to "metric-").
|
String |
getIndexType()
Return the index type (defaults to "metric").
|
String |
getNameField()
Return the name of the field that holds the metric name (defaults to "name").
|
int |
getReadTimeout()
Return the read timeout in seconds.
|
Map<String,String> |
getTags()
Return all the tags.
|
String |
getTemplateName()
Return the name of the elastic template (defaults to "metric-1").
|
String |
getTimestampField()
Return the name of the timestamp field (defaults to "ts").
|
String |
getTypeField()
Return the name of the metric type field (defaults to "type").
|
String |
getUrl()
Return the base url for the ElasticSearch instance.
|
int |
getWriteTimeout()
Return the write timeout in seconds.
|
ElasticReporterConfig |
setClient(okhttp3.OkHttpClient client)
Set the client to use (If not set one will be created).
|
ElasticReporterConfig |
setConnectTimeout(int connectTimeout)
Set the connect timeout in seconds.
|
ElasticReporterConfig |
setDirectory(String directory)
Set the directory where metrics are put if they fail to be sent at report time.
|
ElasticReporterConfig |
setIndexPrefix(String indexPrefix)
Set the index name prefix (defaults to "metric-").
|
ElasticReporterConfig |
setIndexType(String indexType)
Set the index type.
|
ElasticReporterConfig |
setNameField(String nameField)
Set the name of the field that holds the metric name.
|
ElasticReporterConfig |
setReadTimeout(int readTimeout)
Set the read timeout in seconds.
|
ElasticReporterConfig |
setTags(Map<String,String> tags) |
void |
setTemplateName(String templateName)
Set the name of the Elastic template.
|
ElasticReporterConfig |
setTimestampField(String timestampField)
Set the name of the timestamp field.
|
ElasticReporterConfig |
setTypeField(String typeField)
Set the name of the metric type field (defaults to "type").
|
ElasticReporterConfig |
setUrl(String url)
Set the base url for the ElasticSearch instance.
|
ElasticReporterConfig |
setWriteTimeout(int writeTimeout)
Set the write timeout in seconds.
|
public ElasticReporterConfig()
public ElasticReporterConfig setUrl(String url)
public String getIndexType()
public ElasticReporterConfig setIndexType(String indexType)
public String getIndexPrefix()
public ElasticReporterConfig setIndexPrefix(String indexPrefix)
public ElasticReporterConfig addTag(String key, String value)
public ElasticReporterConfig setTags(Map<String,String> tags)
public String getTimestampField()
public ElasticReporterConfig setTimestampField(String timestampField)
public String getTypeField()
public ElasticReporterConfig setTypeField(String typeField)
public String getNameField()
public ElasticReporterConfig setNameField(String nameField)
public String getTemplateName()
public void setTemplateName(String templateName)
Set this to null means the template will not be checked and set on startup.
When changing this value you may want to add a template as a resource under the elastic-template path such that it is checked and set if it does not exist in ElasticSearch.
public int getConnectTimeout()
public ElasticReporterConfig setConnectTimeout(int connectTimeout)
public int getReadTimeout()
public ElasticReporterConfig setReadTimeout(int readTimeout)
public int getWriteTimeout()
public ElasticReporterConfig setWriteTimeout(int writeTimeout)
public String getDirectory()
public ElasticReporterConfig setDirectory(String directory)
public okhttp3.OkHttpClient getClient()
public ElasticReporterConfig setClient(okhttp3.OkHttpClient client)
Copyright © 2017. All rights reserved.