Class SolrSlf4jReporter
- java.lang.Object
-
- org.apache.solr.metrics.SolrMetricReporter
-
- org.apache.solr.metrics.FilteringSolrMetricReporter
-
- org.apache.solr.metrics.reporters.SolrSlf4jReporter
-
- All Implemented Interfaces:
Closeable,AutoCloseable,PluginInfoInitialized
public class SolrSlf4jReporter extends FilteringSolrMetricReporter
Metrics reporter that wrapsSlf4jReporter. The following init arguments are supported:period: (optional, int) number of seconds between reports, default is 60,prefix: (optional, str) prefix for metric names, in addition to registry name. Default is none, ie. just registry name.filter: (optional, str) if not empty only metric names that start with this value will be reported, default is all metrics from a registry,logger: (optional, str) logger name to use. Default is the metrics group, eg.solr.jvm,solr.core, etc
-
-
Field Summary
-
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 SolrSlf4jReporter(SolrMetricManager metricManager, String registryName)Create a SLF4J 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.voidsetLogger(String logger)voidsetPrefix(String prefix)protected voidvalidate()Validates that the reporter has been correctly configured.-
Methods inherited from class org.apache.solr.metrics.FilteringSolrMetricReporter
newMetricFilter, setFilter, setFilter
-
Methods inherited from class org.apache.solr.metrics.SolrMetricReporter
getPeriod, getPluginInfo, init, setEnabled, setPeriod, toString
-
-
-
-
Constructor Detail
-
SolrSlf4jReporter
public SolrSlf4jReporter(SolrMetricManager metricManager, String registryName)
Create a SLF4J reporter for metrics managed in a named registry.- Parameters:
metricManager- metric manager instance that manages the selected registryregistryName- registry to use, one of registries managed bySolrMetricManager
-
-
Method Detail
-
setPrefix
public void setPrefix(String prefix)
-
setLogger
public void setLogger(String logger)
-
doInit
protected void doInit()
Description copied from class:SolrMetricReporterReporter initialization implementation.- Specified by:
doInitin classSolrMetricReporter
-
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
-
-