Class SolrReporter.Builder
- java.lang.Object
-
- org.apache.solr.metrics.reporters.solr.SolrReporter.Builder
-
- Enclosing class:
- SolrReporter
public static class SolrReporter.Builder extends Object
Builder for theSolrReporter
class.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SolrReporter
build(org.apache.http.client.HttpClient client, Supplier<String> urlProvider)
Deprecated.usebuild(SolrClientCache, Supplier)
instead.SolrReporter
build(SolrClientCache solrClientCache, Supplier<String> urlProvider)
Build it.SolrReporter.Builder
cloudClient(boolean cloudClient)
If true then useCloudSolrClient
for communication.SolrReporter.Builder
convertDurationsTo(TimeUnit durationUnit)
Convert durations to the given time unit.SolrReporter.Builder
convertRatesTo(TimeUnit rateUnit)
Convert rates to the given time unit.static SolrReporter.Builder
forReports(SolrMetricManager metricManager, List<SolrReporter.Report> reports)
Create a builder for SolrReporter.SolrReporter.Builder
setCompact(boolean compact)
If true then use "compact" data representation.SolrReporter.Builder
skipAggregateValues(boolean skipAggregateValues)
Individual values fromAggregateMetric
may not be worth to report.SolrReporter.Builder
skipHistograms(boolean skipHistograms)
Histograms are difficult / impossible to aggregate, so it may not be worth to report them.SolrReporter.Builder
withHandler(String handler)
Handler name to use at the remote end.SolrReporter.Builder
withReporterId(String reporterId)
Use this id to identify metrics from this instance.SolrReporter.Builder
withSolrParams(SolrParams params)
AdditionalSolrParams
to add to every request.
-
-
-
Method Detail
-
forReports
public static SolrReporter.Builder forReports(SolrMetricManager metricManager, List<SolrReporter.Report> reports)
Create a builder for SolrReporter.- Parameters:
metricManager
- metric manager that is the source of metricsreports
- report definitions- Returns:
- builder
-
withSolrParams
public SolrReporter.Builder withSolrParams(SolrParams params)
AdditionalSolrParams
to add to every request.- Parameters:
params
- additional params- Returns:
this
-
cloudClient
public SolrReporter.Builder cloudClient(boolean cloudClient)
If true then useCloudSolrClient
for communication. Default is false.- Parameters:
cloudClient
- use CloudSolrClient when true,HttpSolrClient
otherwise.- Returns:
this
-
setCompact
public SolrReporter.Builder setCompact(boolean compact)
If true then use "compact" data representation.- Parameters:
compact
- compact representation.- Returns:
this
-
skipHistograms
public SolrReporter.Builder skipHistograms(boolean skipHistograms)
Histograms are difficult / impossible to aggregate, so it may not be worth to report them.- Parameters:
skipHistograms
- when true then skip histograms from reports- Returns:
this
-
skipAggregateValues
public SolrReporter.Builder skipAggregateValues(boolean skipAggregateValues)
Individual values fromAggregateMetric
may not be worth to report.- Parameters:
skipAggregateValues
- when tru then skip reporting individual values from the metric- Returns:
this
-
withHandler
public SolrReporter.Builder withHandler(String handler)
Handler name to use at the remote end.- Parameters:
handler
- handler name, eg. "/admin/metricsCollector"- Returns:
this
-
withReporterId
public SolrReporter.Builder withReporterId(String reporterId)
Use this id to identify metrics from this instance.- Parameters:
reporterId
- reporter id- Returns:
this
-
convertRatesTo
public SolrReporter.Builder convertRatesTo(TimeUnit rateUnit)
Convert rates to the given time unit.- Parameters:
rateUnit
- a unit of time- Returns:
this
-
convertDurationsTo
public SolrReporter.Builder convertDurationsTo(TimeUnit durationUnit)
Convert durations to the given time unit.- Parameters:
durationUnit
- a unit of time- Returns:
this
-
build
@Deprecated public SolrReporter build(org.apache.http.client.HttpClient client, Supplier<String> urlProvider)
Deprecated.usebuild(SolrClientCache, Supplier)
instead.Build it.- Parameters:
client
- an instance ofHttpClient
to be used for making calls.urlProvider
- function that returns the base URL of Solr instance to target. May return null to indicate that reporting should be skipped. Note: this function will be called every time just before report is sent.- Returns:
- configured instance of reporter
-
build
public SolrReporter build(SolrClientCache solrClientCache, Supplier<String> urlProvider)
Build it.- Parameters:
solrClientCache
- an instance ofSolrClientCache
to be used for making calls.urlProvider
- function that returns the base URL of Solr instance to target. May return null to indicate that reporting should be skipped. Note: this function will be called every time just before report is sent.- Returns:
- configured instance of reporter
-
-