Interface SolrMetricProducer

    • 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 for
        parentName - parent object name, or null if no parent exists
      • initializeMetrics

        @Deprecated
        default void initializeMetrics​(SolrMetricManager manager,
                                       String registry,
                                       String tag,
                                       String scope)
        Initializes metrics specific to this producer
        Parameters:
        manager - an instance of SolrMetricManager
        registry - registry name where metrics are registered
        tag - 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 using SolrMetricsContext.getChildContext(Object) passing this as the child.
        scope - component scope
      • close

        default void close()
                    throws Exception
        Implementations should always call SolrMetricProducer.super.close() to ensure that metrics with the same life-cycle as this component are properly unregistered. This prevents obscure memory leaks.
        Specified by:
        close in interface AutoCloseable
        Throws:
        Exception