Class ElasticsearchReporter.Builder
- java.lang.Object
-
- com.linagora.elasticsearch.metrics.ElasticsearchReporter.Builder
-
- Enclosing class:
- ElasticsearchReporter
public static class ElasticsearchReporter.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ElasticsearchReporter.BuilderadditionalFields(java.util.Map<java.lang.String,?> additionalFields)Additional fields to be included for each metricElasticsearchReporterbuild()ElasticsearchReporter.BuilderbulkSize(int bulkSize)The bulk size per request, defaults to 2500 (as metrics are quite small)ElasticsearchReporter.BuilderconvertDurationsTo(java.util.concurrent.TimeUnit durationUnit)Convert all the durations to a certain timeunit, defaults to millisecondsElasticsearchReporter.BuilderconvertRatesTo(java.util.concurrent.TimeUnit rateUnit)Convert all the rates to a certain timeunit, defaults to secondsElasticsearchReporter.Builderfilter(com.codahale.metrics.MetricFilter filter)Allows to configure a special MetricFilter, which defines what metrics are reportedElasticsearchReporter.Builderhosts(java.lang.String... hosts)Configure an array of hosts to send data to.ElasticsearchReporter.Builderindex(java.lang.String index)The index name to index inElasticsearchReporter.BuilderindexDateFormat(java.lang.String indexDateFormat)The index date format used for rolling indices This is appended to the index name, split by a '-'ElasticsearchReporter.BuilderpercolationFilter(com.codahale.metrics.MetricFilter percolationFilter)A metrics filter to define the metrics which should be used for percolation/notificationElasticsearchReporter.BuilderpercolationNotifier(Notifier notifier)An instance of the notifier implemention which should be executed in case of a matching percolationElasticsearchReporter.BuilderprefixedWith(java.lang.String prefix)Configure a prefix for each metric name.ElasticsearchReporter.Buildertimeout(int timeout)The timeout to wait for until a connection attempt is and the next host is triedElasticsearchReporter.BuildertimestampFieldname(java.lang.String fieldName)Configure the name of the timestamp field, defaults to '@timestamp'ElasticsearchReporter.BuilderwithClock(com.codahale.metrics.Clock clock)Inject your custom definition of how time passes.
-
-
-
Method Detail
-
withClock
public ElasticsearchReporter.Builder withClock(com.codahale.metrics.Clock clock)
Inject your custom definition of how time passes. Usually the default clock is sufficient
-
prefixedWith
public ElasticsearchReporter.Builder prefixedWith(java.lang.String prefix)
Configure a prefix for each metric name. Optional, but useful to identify single hosts
-
convertRatesTo
public ElasticsearchReporter.Builder convertRatesTo(java.util.concurrent.TimeUnit rateUnit)
Convert all the rates to a certain timeunit, defaults to seconds
-
convertDurationsTo
public ElasticsearchReporter.Builder convertDurationsTo(java.util.concurrent.TimeUnit durationUnit)
Convert all the durations to a certain timeunit, defaults to milliseconds
-
filter
public ElasticsearchReporter.Builder filter(com.codahale.metrics.MetricFilter filter)
Allows to configure a special MetricFilter, which defines what metrics are reported
-
hosts
public ElasticsearchReporter.Builder hosts(java.lang.String... hosts)
Configure an array of hosts to send data to. Note: Data is always sent to only one host, but this makes sure, that even if a part of your elasticsearch cluster is not running, reporting still happens A host must be in the format hostname:port The port must be the HTTP port of your elasticsearch instance
-
timeout
public ElasticsearchReporter.Builder timeout(int timeout)
The timeout to wait for until a connection attempt is and the next host is tried
-
index
public ElasticsearchReporter.Builder index(java.lang.String index)
The index name to index in
-
indexDateFormat
public ElasticsearchReporter.Builder indexDateFormat(java.lang.String indexDateFormat)
The index date format used for rolling indices This is appended to the index name, split by a '-'
-
bulkSize
public ElasticsearchReporter.Builder bulkSize(int bulkSize)
The bulk size per request, defaults to 2500 (as metrics are quite small)
-
percolationFilter
public ElasticsearchReporter.Builder percolationFilter(com.codahale.metrics.MetricFilter percolationFilter)
A metrics filter to define the metrics which should be used for percolation/notification
-
percolationNotifier
public ElasticsearchReporter.Builder percolationNotifier(Notifier notifier)
An instance of the notifier implemention which should be executed in case of a matching percolation
-
timestampFieldname
public ElasticsearchReporter.Builder timestampFieldname(java.lang.String fieldName)
Configure the name of the timestamp field, defaults to '@timestamp'
-
additionalFields
public ElasticsearchReporter.Builder additionalFields(java.util.Map<java.lang.String,?> additionalFields)
Additional fields to be included for each metric- Parameters:
additionalFields-- Returns:
-
build
public ElasticsearchReporter build() throws java.io.IOException
- Throws:
java.io.IOException
-
-