Package org.apache.solr.util.stats
Class InstrumentedPoolingHttpClientConnectionManager
- java.lang.Object
-
- org.apache.http.impl.conn.PoolingHttpClientConnectionManager
-
- org.apache.solr.util.stats.InstrumentedPoolingHttpClientConnectionManager
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.http.conn.HttpClientConnectionManager
,org.apache.http.pool.ConnPoolControl<org.apache.http.conn.routing.HttpRoute>
,SolrMetricProducer
public class InstrumentedPoolingHttpClientConnectionManager extends org.apache.http.impl.conn.PoolingHttpClientConnectionManager implements SolrMetricProducer
Sub-class of PoolingHttpClientConnectionManager which tracks metrics interesting to Solr. Inspired by dropwizard metrics-httpclient library implementation.
-
-
Constructor Summary
Constructors Constructor Description InstrumentedPoolingHttpClientConnectionManager(org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> socketFactoryRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SolrMetricsContext
getSolrMetricsContext()
Implementing classes should override this method to provide the context obtained 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 org.apache.http.impl.conn.PoolingHttpClientConnectionManager
close, closeExpiredConnections, closeIdleConnections, connect, enumAvailable, enumLeased, finalize, getConnectionConfig, getDefaultConnectionConfig, getDefaultMaxPerRoute, getDefaultSocketConfig, getMaxPerRoute, getMaxTotal, getRoutes, getSocketConfig, getStats, getTotalStats, getValidateAfterInactivity, leaseConnection, releaseConnection, requestConnection, routeComplete, setConnectionConfig, setDefaultConnectionConfig, setDefaultMaxPerRoute, setDefaultSocketConfig, setMaxPerRoute, setMaxTotal, setSocketConfig, setValidateAfterInactivity, shutdown, upgrade
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close, initializeMetrics
-
-
-
-
Method Detail
-
getSolrMetricsContext
public SolrMetricsContext getSolrMetricsContext()
Description copied from interface:SolrMetricProducer
Implementing classes should override this method to provide the context obtained inSolrMetricProducer.initializeMetrics(SolrMetricsContext, String)
to ensure proper cleanup of metrics at the end of the life-cycle of this component.- Specified by:
getSolrMetricsContext
in interfaceSolrMetricProducer
-
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.scope
- component scope
-
-