Package org.apache.solr.util.stats
Class InstrumentedHttpListenerFactory
- java.lang.Object
-
- org.apache.solr.util.stats.InstrumentedHttpListenerFactory
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.solr.client.solrj.impl.HttpListenerFactory
,SolrMetricProducer
public class InstrumentedHttpListenerFactory extends Object implements SolrMetricProducer, org.apache.solr.client.solrj.impl.HttpListenerFactory
A HttpListenerFactory tracks metrics interesting to solr Inspired and partially copied from dropwizard httpclient library
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
InstrumentedHttpListenerFactory.NameStrategy
-
Field Summary
Fields Modifier and Type Field Description static Map<String,InstrumentedHttpListenerFactory.NameStrategy>
KNOWN_METRIC_NAME_STRATEGIES
protected InstrumentedHttpListenerFactory.NameStrategy
nameStrategy
protected String
scope
protected SolrMetricsContext
solrMetricsContext
-
Constructor Summary
Constructors Constructor Description InstrumentedHttpListenerFactory(InstrumentedHttpListenerFactory.NameStrategy nameStrategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.solr.client.solrj.impl.HttpListenerFactory.RequestResponseListener
get()
SolrMetricsContext
getSolrMetricsContext()
Implementations should return the context used inSolrMetricProducer.initializeMetrics(SolrMetricsContext, String)
to ensure proper cleanup of metrics at the end of the life-cycle of this component.void
initializeMetrics(SolrMetricsContext parentContext, String scope)
Initialize metrics specific to this producer.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
-
-
-
Field Detail
-
KNOWN_METRIC_NAME_STRATEGIES
public static final Map<String,InstrumentedHttpListenerFactory.NameStrategy> KNOWN_METRIC_NAME_STRATEGIES
-
solrMetricsContext
protected SolrMetricsContext solrMetricsContext
-
scope
protected String scope
-
nameStrategy
protected InstrumentedHttpListenerFactory.NameStrategy nameStrategy
-
-
Constructor Detail
-
InstrumentedHttpListenerFactory
public InstrumentedHttpListenerFactory(InstrumentedHttpListenerFactory.NameStrategy nameStrategy)
-
-
Method Detail
-
get
public org.apache.solr.client.solrj.impl.HttpListenerFactory.RequestResponseListener get()
- Specified by:
get
in interfaceorg.apache.solr.client.solrj.impl.HttpListenerFactory
-
initializeMetrics
public void initializeMetrics(SolrMetricsContext parentContext, String scope)
Description copied from interface:SolrMetricProducer
Initialize metrics specific to this producer.- Specified by:
initializeMetrics
in interfaceSolrMetricProducer
- Parameters:
parentContext
- parent metrics context. If this component has the same life-cycle as the parent it can simply use the parent context, otherwise it should obtain a child context usingSolrMetricsContext.getChildContext(Object)
passingthis
as the child object.scope
- component scope
-
getSolrMetricsContext
public SolrMetricsContext getSolrMetricsContext()
Description copied from interface:SolrMetricProducer
Implementations should return the context used inSolrMetricProducer.initializeMetrics(SolrMetricsContext, String)
to ensure proper cleanup of metrics at the end of the life-cycle of this component. This should be the child context if one was created, or null if the parent context was used.- Specified by:
getSolrMetricsContext
in interfaceSolrMetricProducer
-
-