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 void
close()
protected void
doInit()
Reporter initialization implementation.void
setLogger(String logger)
void
setPrefix(String prefix)
protected void
validate()
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:SolrMetricReporter
Reporter initialization implementation.- Specified by:
doInit
in classSolrMetricReporter
-
validate
protected void validate() throws IllegalStateException
Description copied from class:SolrMetricReporter
Validates that the reporter has been correctly configured.- Specified by:
validate
in classSolrMetricReporter
- Throws:
IllegalStateException
- if the reporter is not properly configured
-
close
public void close() throws IOException
- Throws:
IOException
-
-