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 theSolrReporterclass.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SolrReporterbuild(org.apache.http.client.HttpClient client, Supplier<String> urlProvider)Deprecated.usebuild(SolrClientCache, Supplier)instead.SolrReporterbuild(SolrClientCache solrClientCache, Supplier<String> urlProvider)Build it.SolrReporter.BuildercloudClient(boolean cloudClient)If true then useCloudSolrClientfor communication.SolrReporter.BuilderconvertDurationsTo(TimeUnit durationUnit)Convert durations to the given time unit.SolrReporter.BuilderconvertRatesTo(TimeUnit rateUnit)Convert rates to the given time unit.static SolrReporter.BuilderforReports(SolrMetricManager metricManager, List<SolrReporter.Report> reports)Create a builder for SolrReporter.SolrReporter.BuildersetCompact(boolean compact)If true then use "compact" data representation.SolrReporter.BuilderskipAggregateValues(boolean skipAggregateValues)Individual values fromAggregateMetricmay not be worth to report.SolrReporter.BuilderskipHistograms(boolean skipHistograms)Histograms are difficult / impossible to aggregate, so it may not be worth to report them.SolrReporter.BuilderwithHandler(String handler)Handler name to use at the remote end.SolrReporter.BuilderwithReporterId(String reporterId)Use this id to identify metrics from this instance.SolrReporter.BuilderwithSolrParams(org.apache.solr.common.params.SolrParams params)AdditionalSolrParamsto 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(org.apache.solr.common.params.SolrParams params)
AdditionalSolrParamsto add to every request.- Parameters:
params- additional params- Returns:
this
-
cloudClient
public SolrReporter.Builder cloudClient(boolean cloudClient)
If true then useCloudSolrClientfor communication. Default is false.- Parameters:
cloudClient- use CloudSolrClient when true,HttpSolrClientotherwise.- 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 fromAggregateMetricmay 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 ofHttpClientto 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 ofSolrClientCacheto 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
-
-