Package org.apache.solr.metrics
Interface SolrMetricProducer
-
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
SolrCache<K,V>
- All Known Implementing Classes:
AnalysisRequestHandlerBase,AuditLoggerPlugin,AuthenticationPlugin,AutoScalingHandler,AutoscalingHistoryHandler,BasicAuthPlugin,BlobHandler,BreakIteratorBoundaryScanner,CaffeineCache,CdcrRequestHandler,CdcrUpdateLog,CollectionsHandler,ConfigSetsHandler,ConfigurableInternodeAuthHadoopPlugin,ContentStreamHandlerBase,CoreAdminHandler,DefaultEncoder,DirectUpdateHandler2,DocumentAnalysisRequestHandler,DumpRequestHandler,ExportHandler,FastLRUCache,FieldAnalysisRequestHandler,FileFloatSource.ReloadCacheRequestHandler,GapFragmenter,GraphHandler,HadoopAuthPlugin,HdfsDirectoryFactory,HdfsLocalityReporter,HdfsUpdateLog,HealthCheckHandler,HighlightingPluginBase,HtmlEncoder,HtmlFormatter,HttpShardHandlerFactory,InfoHandler,InstrumentedHttpListenerFactory,InstrumentedHttpRequestExecutor,InstrumentedPoolingHttpClientConnectionManager,JWTAuthPlugin,KerberosPlugin,LFUCache,LoggingHandler,LRUCache,LukeRequestHandler,Metrics,MetricsCollectorHandler,MetricsHandler,MetricsHistoryHandler,MoreLikeThisHandler,MultiDestinationAuditLogger,NotFoundRequestHandler,PeerSync,PeerSyncWithLeader,PingRequestHandler,PKIAuthenticationPlugin,PluginInfoHandler,PropertiesRequestHandler,PublicKeyHandler,RealTimeGetHandler,RegexFragmenter,ReplicationHandler,RequestHandlerBase,SchemaHandler,ScoreOrderFragmentsBuilder,SearchHandler,SecurityConfHandler,SecurityConfHandlerLocal,SecurityConfHandlerZk,SegmentsInfoRequestHandler,ShowFileRequestHandler,SimpleBoundaryScanner,SimpleFragListBuilder,SimpleFragmentsBuilder,SingleFragListBuilder,SolrBoundaryScanner,SolrCacheHolder,SolrConfigHandler,SolrCore,SolrFieldCacheBean,SolrFragmentsBuilder,SolrIndexSearcher,SolrInfoMBeanHandler,SolrLogAuditLoggerPlugin,SQLHandler,StandardRequestHandler,StreamHandler,SuggestComponent,SystemInfoHandler,TaggerRequestHandler,ThreadDumpHandler,UpdateLog,UpdateRequestHandler,UpdateRequestHandlerApi,UpdateShardHandler,WeightedFragListBuilder,ZookeeperInfoHandler,ZookeeperStatusHandler
public interface SolrMetricProducer extends AutoCloseable
Used by objects that expose metrics throughSolrMetricManager.
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default voidclose()Implementations should always callSolrMetricProducer.super.close()to ensure that metrics with the same life-cycle as this component are properly unregistered.default SolrMetricsContextgetSolrMetricsContext()Implementing classes should override this method to provide the context obtained ininitializeMetrics(SolrMetricsContext, String)to ensure proper cleanup of metrics at the end of the life-cycle of this component.static StringgetUniqueMetricTag(Object o, String parentName)Unique metric tag identifies components with the same life-cycle, which should be registered / unregistered together.default voidinitializeMetrics(SolrMetricManager manager, String registry, String tag, String scope)Deprecated.useinitializeMetrics(SolrMetricsContext, String)insteaddefault voidinitializeMetrics(SolrMetricsContext parentContext, String scope)Initialize metrics specific to this producer.
-
-
-
Method Detail
-
getUniqueMetricTag
static String getUniqueMetricTag(Object o, String parentName)
Unique metric tag identifies components with the same life-cycle, which should be registered / unregistered together. It is in the format of A:B:C, where A is the parent of B is the parent of C and so on. If object "B" is unregistered C also must get unregistered. If object "A" is unregistered B and C also must get unregistered.- Parameters:
o- object to create a tag forparentName- parent object name, or null if no parent exists
-
initializeMetrics
@Deprecated default void initializeMetrics(SolrMetricManager manager, String registry, String tag, String scope)
Deprecated.useinitializeMetrics(SolrMetricsContext, String)insteadInitializes metrics specific to this producer- Parameters:
manager- an instance ofSolrMetricManagerregistry- registry name where metrics are registeredtag- a symbolic tag that represents this instance of the producer, or a group of related instances that have the same life-cycle. This tag is used when managing life-cycle of some metrics.scope- scope of the metrics (eg. handler name) to separate metrics of components with the same implementation but different scope.
-
initializeMetrics
default void initializeMetrics(SolrMetricsContext parentContext, String scope)
Initialize metrics specific to this producer.- 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)passingthisas the child.scope- component scope
-
getSolrMetricsContext
default SolrMetricsContext getSolrMetricsContext()
Implementing classes should override this method to provide the context obtained ininitializeMetrics(SolrMetricsContext, String)to ensure proper cleanup of metrics at the end of the life-cycle of this component.
-
close
default void close() throws ExceptionImplementations should always callSolrMetricProducer.super.close()to ensure that metrics with the same life-cycle as this component are properly unregistered. This prevents obscure memory leaks.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-