Class SolrReporter
- java.lang.Object
-
- com.codahale.metrics.ScheduledReporter
-
- org.apache.solr.metrics.reporters.solr.SolrReporter
-
- All Implemented Interfaces:
com.codahale.metrics.Reporter
,Closeable
,AutoCloseable
public class SolrReporter extends com.codahale.metrics.ScheduledReporter
Implementation ofScheduledReporter
that reports metrics from selected registries and sends them periodically as update requests to a selected Solr collection and to a configured handler.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SolrReporter.Builder
Builder for theSolrReporter
class.static class
SolrReporter.Report
Specification of what registries and what metrics to send.
-
Field Summary
Fields Modifier and Type Field Description static String
GROUP_ID
static String
LABEL_ID
static String
REGISTRY_ID
static String
REPORTER_ID
-
Constructor Summary
Constructors Constructor Description SolrReporter(org.apache.http.client.HttpClient httpClient, Supplier<String> urlProvider, SolrMetricManager metricManager, List<SolrReporter.Report> metrics, String handler, String reporterId, TimeUnit rateUnit, TimeUnit durationUnit, org.apache.solr.common.params.SolrParams params, boolean skipHistograms, boolean skipAggregateValues, boolean cloudClient, boolean compact)
SolrReporter(SolrClientCache solrClientCache, boolean closeClientCache, Supplier<String> urlProvider, SolrMetricManager metricManager, List<SolrReporter.Report> metrics, String handler, String reporterId, TimeUnit rateUnit, TimeUnit durationUnit, org.apache.solr.common.params.SolrParams params, boolean skipHistograms, boolean skipAggregateValues, boolean cloudClient, boolean compact)
Create a SolrReporter instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
report()
void
report(SortedMap<String,com.codahale.metrics.Gauge> gauges, SortedMap<String,com.codahale.metrics.Counter> counters, SortedMap<String,com.codahale.metrics.Histogram> histograms, SortedMap<String,com.codahale.metrics.Meter> meters, SortedMap<String,com.codahale.metrics.Timer> timers)
-
-
-
Field Detail
-
REGISTRY_ID
public static final String REGISTRY_ID
- See Also:
- Constant Field Values
-
REPORTER_ID
public static final String REPORTER_ID
- See Also:
- Constant Field Values
-
GROUP_ID
public static final String GROUP_ID
- See Also:
- Constant Field Values
-
LABEL_ID
public static final String LABEL_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SolrReporter
@Deprecated public SolrReporter(org.apache.http.client.HttpClient httpClient, Supplier<String> urlProvider, SolrMetricManager metricManager, List<SolrReporter.Report> metrics, String handler, String reporterId, TimeUnit rateUnit, TimeUnit durationUnit, org.apache.solr.common.params.SolrParams params, boolean skipHistograms, boolean skipAggregateValues, boolean cloudClient, boolean compact)
Deprecated.Create a SolrReporter instance.- Parameters:
httpClient
- HttpClient to use for constructing SolrClient instances.urlProvider
- what URL to send to.metricManager
- metric managermetrics
- metric specifications to reporthandler
- handler name to report toreporterId
- my reporter idrateUnit
- rate unitdurationUnit
- duration unitparams
- request parametersskipHistograms
- if true then don't send histogram metricsskipAggregateValues
- if true then don't send aggregate metrics' individual valuescloudClient
- if true then use CloudSolrClient, plain HttpSolrClient otherwise.compact
- if true then use compact representation.
-
SolrReporter
public SolrReporter(SolrClientCache solrClientCache, boolean closeClientCache, Supplier<String> urlProvider, SolrMetricManager metricManager, List<SolrReporter.Report> metrics, String handler, String reporterId, TimeUnit rateUnit, TimeUnit durationUnit, org.apache.solr.common.params.SolrParams params, boolean skipHistograms, boolean skipAggregateValues, boolean cloudClient, boolean compact)
Create a SolrReporter instance.- Parameters:
solrClientCache
- client cache to use for constructing SolrClient instances.urlProvider
- what URL to send to.metricManager
- metric managermetrics
- metric specifications to reporthandler
- handler name to report toreporterId
- my reporter idrateUnit
- rate unitdurationUnit
- duration unitparams
- request parametersskipHistograms
- if true then don't send histogram metricsskipAggregateValues
- if true then don't send aggregate metrics' individual valuescloudClient
- if true then use CloudSolrClient, plain HttpSolrClient otherwise.compact
- if true then use compact representation.
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classcom.codahale.metrics.ScheduledReporter
-
report
public void report()
- Overrides:
report
in classcom.codahale.metrics.ScheduledReporter
-
report
public void report(SortedMap<String,com.codahale.metrics.Gauge> gauges, SortedMap<String,com.codahale.metrics.Counter> counters, SortedMap<String,com.codahale.metrics.Histogram> histograms, SortedMap<String,com.codahale.metrics.Meter> meters, SortedMap<String,com.codahale.metrics.Timer> timers)
- Specified by:
report
in classcom.codahale.metrics.ScheduledReporter
-
-