Class SolrShardReporter
- java.lang.Object
-
- org.apache.solr.metrics.SolrMetricReporter
-
- org.apache.solr.metrics.FilteringSolrMetricReporter
-
- org.apache.solr.metrics.SolrCoreReporter
-
- org.apache.solr.metrics.reporters.solr.SolrShardReporter
-
- All Implemented Interfaces:
Closeable,AutoCloseable,PluginInfoInitialized
public class SolrShardReporter extends SolrCoreReporter
This class reports selected metrics from replicas to shard leader.The following configuration properties are supported:
- handler - (optional str) handler path where reports are sent. Default is
MetricsCollectorHandler.HANDLER_PATH. - period - (optional int) how often reports are sent, in seconds. Default is 60. Setting this to 0 disables the reporter.
- filter - (optional multiple str) regex expression(s) matching selected metrics to be reported.
DEFAULT_FILTERS.Example configuration:
<reporter name="test" group="shard" class="solr.SolrShardReporter"> <int name="period">11</int> <str name="filter">UPDATE\./update/.*requests</str> <str name="filter">QUERY\./select.*requests</str> </reporter>
-
-
Field Summary
Fields Modifier and Type Field Description static List<String>DEFAULT_FILTERS-
Fields inherited from class org.apache.solr.metrics.SolrCoreReporter
core
-
Fields inherited from class org.apache.solr.metrics.FilteringSolrMetricReporter
filters
-
Fields inherited from class org.apache.solr.metrics.SolrMetricReporter
enabled, metricManager, period, pluginInfo, registryName
-
-
Constructor Summary
Constructors Constructor Description SolrShardReporter(SolrMetricManager metricManager, String registryName)Create a reporter for metrics managed in a named registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voiddoInit()Reporter initialization implementation.voidinit(PluginInfo pluginInfo, SolrCore core)protected com.codahale.metrics.MetricFilternewMetricFilter()Report only metrics with names matching any of the prefix filters.voidsetHandler(String handler)protected voidvalidate()Validates that the reporter has been correctly configured.-
Methods inherited from class org.apache.solr.metrics.SolrCoreReporter
getCore, init
-
Methods inherited from class org.apache.solr.metrics.FilteringSolrMetricReporter
setFilter, setFilter
-
Methods inherited from class org.apache.solr.metrics.SolrMetricReporter
getPeriod, getPluginInfo, setEnabled, setPeriod, toString
-
-
-
-
Constructor Detail
-
SolrShardReporter
public SolrShardReporter(SolrMetricManager metricManager, String registryName)
Create a reporter for metrics managed in a named registry.- Parameters:
metricManager- metric managerregistryName- registry to use, one of registries managed bySolrMetricManager
-
-
Method Detail
-
setHandler
public void setHandler(String handler)
-
doInit
protected void doInit()
Description copied from class:SolrMetricReporterReporter initialization implementation.- Specified by:
doInitin classSolrMetricReporter
-
newMetricFilter
protected com.codahale.metrics.MetricFilter newMetricFilter()
Description copied from class:FilteringSolrMetricReporterReport only metrics with names matching any of the prefix filters. If the filters list is empty then all names will match.- Overrides:
newMetricFilterin classFilteringSolrMetricReporter
-
validate
protected void validate() throws IllegalStateExceptionDescription copied from class:SolrMetricReporterValidates that the reporter has been correctly configured.- Specified by:
validatein classSolrMetricReporter- Throws:
IllegalStateException- if the reporter is not properly configured
-
close
public void close() throws IOException- Throws:
IOException
-
init
public void init(PluginInfo pluginInfo, SolrCore core)
- Overrides:
initin classSolrCoreReporter
-
-