lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject lucene-solr:feature/metrics: SOLR-4735 Introduce a concept of top-level group of metrics for things that happen outside SolrCore.
Date Thu, 01 Dec 2016 13:26:12 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/feature/metrics f489bb856 -> 1bc01d25e


SOLR-4735 Introduce a concept of top-level group of metrics for things
that happen outside SolrCore.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/1bc01d25
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/1bc01d25
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/1bc01d25

Branch: refs/heads/feature/metrics
Commit: 1bc01d25ef2fa8fa015ba2fdb5b2ffc8ae3cec0a
Parents: f489bb8
Author: Andrzej Bialecki <ab@apache.org>
Authored: Thu Dec 1 14:24:56 2016 +0100
Committer: Andrzej Bialecki <ab@apache.org>
Committed: Thu Dec 1 14:24:56 2016 +0100

----------------------------------------------------------------------
 .../core/src/java/org/apache/solr/core/SolrInfoMBean.java | 10 +++++++++-
 .../org/apache/solr/metrics/SolrCoreMetricManager.java    |  6 ++----
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1bc01d25/solr/core/src/java/org/apache/solr/core/SolrInfoMBean.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/SolrInfoMBean.java b/solr/core/src/java/org/apache/solr/core/SolrInfoMBean.java
index c119e2f..c5fb84b 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrInfoMBean.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrInfoMBean.java
@@ -29,7 +29,15 @@ import org.apache.solr.common.util.NamedList;
  */
 public interface SolrInfoMBean {
 
-  public enum Category { CORE, QUERYHANDLER, UPDATEHANDLER, CACHE, HIGHLIGHTING, QUERYPARSER,
OTHER };
+  /**
+   * Category of {@link SolrCore} component.
+   */
+  enum Category { CORE, QUERYHANDLER, UPDATEHANDLER, CACHE, HIGHLIGHTING, QUERYPARSER, OTHER
}
+
+  /**
+   * Top-level group of beans for a subsystem.
+   */
+  enum Group { jvm, jetty, http, node, core }
 
   /**
    * Simple common usage name, e.g. BasicQueryHandler,

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1bc01d25/solr/core/src/java/org/apache/solr/metrics/SolrCoreMetricManager.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/metrics/SolrCoreMetricManager.java b/solr/core/src/java/org/apache/solr/metrics/SolrCoreMetricManager.java
index 960ccba..60c461b 100644
--- a/solr/core/src/java/org/apache/solr/metrics/SolrCoreMetricManager.java
+++ b/solr/core/src/java/org/apache/solr/metrics/SolrCoreMetricManager.java
@@ -28,6 +28,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import com.codahale.metrics.MetricRegistry;
 import org.apache.solr.core.PluginInfo;
 import org.apache.solr.core.SolrCore;
+import org.apache.solr.core.SolrInfoMBean;
 import org.apache.solr.core.SolrResourceLoader;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -38,8 +39,6 @@ import org.slf4j.LoggerFactory;
  */
 public class SolrCoreMetricManager implements Closeable {
 
-  public static final String REGISTRY_PREFIX = "core";
-
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private final SolrCore core;
@@ -58,7 +57,7 @@ public class SolrCoreMetricManager implements Closeable {
   }
 
   public static final String getRegistryName(String coreName) {
-    return SolrMetricManager.overridableRegistryName(MetricRegistry.name(REGISTRY_PREFIX,
coreName));
+    return SolrMetricManager.overridableRegistryName(MetricRegistry.name(SolrInfoMBean.Group.core.toString(),
coreName));
   }
 
   /**
@@ -126,7 +125,6 @@ public class SolrCoreMetricManager implements Closeable {
    */
   @Override
   public void close() throws IOException {
-    // Close reporters first to ensure no reporter is listening to the registry.
     Iterator<Map.Entry<String, SolrMetricReporter>> it = reporters.entrySet().iterator();
     while (it.hasNext()) {
       Map.Entry<String, SolrMetricReporter> entry = it.next();


Mime
View raw message