Package org.apache.solr.metrics
Interface SolrMetricProducer
-
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
SolrCache<K,V>
,SolrEncoder
,SolrFormatter
,SolrFragListBuilder
,SolrFragmenter
,SolrInfoBean
,SolrRequestHandler
- All Known Implementing Classes:
ActiveTasksListComponent
,ActiveTasksListHandler
,AnalysisRequestHandlerBase
,AuditLoggerPlugin
,AuthenticationPlugin
,BasicAuthPlugin
,BlobHandler
,BlockJoinChildQParserPlugin
,BlockJoinParentQParserPlugin
,BoolQParserPlugin
,BoostQParserPlugin
,BreakIteratorBoundaryScanner
,CaffeineCache
,CertAuthPlugin
,CollapsingQParserPlugin
,CollectionsHandler
,ComplexPhraseQParserPlugin
,ConfigSetsHandler
,ContentStreamHandlerBase
,CoreAdminHandler
,DebugComponent
,DefaultEncoder
,DirectUpdateHandler2
,DisMaxQParserPlugin
,DocumentAnalysisRequestHandler
,DumpRequestHandler
,ExpandComponent
,ExportHandler
,ExportQParserPlugin
,ExtendedDismaxQParserPlugin
,FacetComponent
,FacetModule
,FieldAnalysisRequestHandler
,FieldQParserPlugin
,FileFloatSource.ReloadCacheRequestHandler
,FiltersQParserPlugin
,FunctionQParserPlugin
,FunctionRangeQParserPlugin
,GapFragmenter
,GraphHandler
,GraphQParserPlugin
,GraphTermsQParserPlugin
,HashQParserPlugin
,HashRangeQParserPlugin
,HealthCheckHandler
,HighlightComponent
,HighlightingPluginBase
,HtmlEncoder
,HtmlFormatter
,HttpShardHandlerFactory
,IGainTermsQParserPlugin
,InfoHandler
,InstrumentedHttpListenerFactory
,InstrumentedHttpRequestExecutor
,InstrumentedPoolingHttpClientConnectionManager
,JoinQParserPlugin
,KnnQParserPlugin
,LoggingHandler
,LuceneQParserPlugin
,LukeRequestHandler
,MaxScoreQParserPlugin
,MetricsCollectorHandler
,MetricsHandler
,MinHashQParserPlugin
,MLTQParserPlugin
,MoreLikeThisComponent
,MoreLikeThisHandler
,MultiAuthPlugin
,MultiDestinationAuditLogger
,NestedQParserPlugin
,NotFoundRequestHandler
,PayloadCheckQParserPlugin
,PayloadScoreQParserPlugin
,PeerSync
,PeerSyncWithLeader
,PhrasesIdentificationComponent
,PingRequestHandler
,PKIAuthenticationPlugin
,PluginInfoHandler
,PrefixQParserPlugin
,PropertiesRequestHandler
,PublicKeyHandler
,QParserPlugin
,QueryCancellationComponent
,QueryCancellationHandler
,QueryComponent
,QueryElevationComponent
,RankQParserPlugin
,RawQParserPlugin
,RealTimeGetComponent
,RealTimeGetHandler
,RegexFragmenter
,ReplicationHandler
,RequestHandlerBase
,ReRankQParserPlugin
,ResponseLogComponent
,SchemaHandler
,ScoreJoinQParserPlugin
,ScoreOrderFragmentsBuilder
,SearchComponent
,SearchHandler
,SecurityConfHandler
,SecurityConfHandlerLocal
,SecurityConfHandlerZk
,SegmentsInfoRequestHandler
,ShowFileRequestHandler
,SignificantTermsQParserPlugin
,SimpleBoundaryScanner
,SimpleFragListBuilder
,SimpleFragmentsBuilder
,SimpleQParserPlugin
,SingleFragListBuilder
,SolrBoundaryScanner
,SolrConfigHandler
,SolrCore
,SolrFieldCacheBean
,SolrFragmentsBuilder
,SolrIndexSearcher
,SolrInfoMBeanHandler
,SolrLogAuditLoggerPlugin
,SpatialBoxQParserPlugin
,SpatialFilterQParserPlugin
,SpellCheckComponent
,StandardRequestHandler
,StatsComponent
,StreamHandler
,SuggestComponent
,SurroundQParserPlugin
,SwitchQParserPlugin
,SystemInfoHandler
,TaggerRequestHandler
,TaskManagementHandler
,TermQParserPlugin
,TermsComponent
,TermsQParserPlugin
,TermVectorComponent
,TextLogisticRegressionQParserPlugin
,ThreadDumpHandler
,UpdateHandler
,UpdateLog
,UpdateRequestHandler
,UpdateRequestHandlerApi
,UpdateShardHandler
,WeightedFragListBuilder
,XmlQParserPlugin
,ZookeeperInfoHandler
,ZookeeperStatusHandler
public interface SolrMetricProducer extends AutoCloseable
Used by objects that expose metrics throughSolrMetricManager
.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
Implementations should always callSolrMetricProducer.super.close()
to ensure that metrics with the same life-cycle as this component are properly unregistered.SolrMetricsContext
getSolrMetricsContext()
Implementations should return the context used ininitializeMetrics(SolrMetricsContext, String)
to ensure proper cleanup of metrics at the end of the life-cycle of this component.static String
getUniqueMetricTag(Object o, String parentName)
Unique metric tag identifies components with the same life-cycle, which should be registered / unregistered together.void
initializeMetrics(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
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)
passingthis
as the child object.scope
- component scope
-
getSolrMetricsContext
SolrMetricsContext getSolrMetricsContext()
Implementations should return the context used ininitializeMetrics(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.
-
close
default void close() throws IOException
Implementations 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.from: https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html While this interface method is declared to throw Exception, implementers are strongly encouraged to declare concrete implementations of the close method to throw more specific exceptions, or to throw no exception at all if the close operation cannot fail.
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
-