Class SolrCoreMetricManager

    • Constructor Detail

      • SolrCoreMetricManager

        public SolrCoreMetricManager​(SolrCore core)
        Constructs a metric manager.
        Parameters:
        core - the metric manager's core
    • Method Detail

      • loadReporters

        public void loadReporters()
        Load reporters configured globally and specific to SolrInfoBean.Group.core group or with a registry name specific to this core.
      • afterCoreSetName

        public void afterCoreSetName()
        Make sure that metrics already collected that correspond to the old core name are carried over and will be used under the new core name. This method also reloads reporters so that they use the new core name.
      • registerMetricProducer

        public void registerMetricProducer​(String scope,
                                           SolrMetricProducer producer)
        Registers a mapping of name/metric's with the manager's metric registry.
        Parameters:
        scope - the scope of the metrics to be registered (e.g. `/admin/ping`)
        producer - producer of metrics to be registered
      • getRegistry

        public com.codahale.metrics.MetricRegistry getRegistry()
        Return the registry used by this SolrCore.
      • getRegistryName

        public String getRegistryName()
        Metric registry name of the manager. In order to make it easier for reporting tools to aggregate metrics from different cores that logically belong to a single collection we convert the core name into a dot-separated hierarchy of: collection name, shard name (with optional split) and replica name.

        For example, when the core name looks like this but it's NOT a SolrCloud collection: my_collection_shard1_1_replica1 then this will be used as the registry name (plus the required solr.core prefix). However, if this is a SolrCloud collection my_collection then the registry name will become solr.core.my_collection.shard1_1.replica1.

        Returns:
        the metric registry name of the manager.
      • getLeaderRegistryName

        public String getLeaderRegistryName()
        Metric registry name for leader metrics. This is null if not in cloud mode.
        Returns:
        metric registry name for leader metrics
      • getTag

        public String getTag()
        Return a tag specific to this instance.
      • createRegistryName

        public static String createRegistryName​(boolean cloud,
                                                String collectionName,
                                                String shardName,
                                                String replicaName,
                                                String coreName)
      • createLeaderRegistryName

        public static String createLeaderRegistryName​(boolean cloud,
                                                      String collectionName,
                                                      String shardName)