lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kris...@apache.org
Subject [18/25] lucene-solr:jira/solr-8593: SOLR-9923: Remove solr.http metric group and merge its metrics to solr.node group
Date Fri, 06 Jan 2017 21:47:38 GMT
SOLR-9923: Remove solr.http metric group and merge its metrics to solr.node group


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

Branch: refs/heads/jira/solr-8593
Commit: e5d28848d7d98d52b378b2be18203f058a48a2cc
Parents: 7ef6a81
Author: Shalin Shekhar Mangar <shalin@apache.org>
Authored: Thu Jan 5 20:25:23 2017 +0530
Committer: Shalin Shekhar Mangar <shalin@apache.org>
Committed: Thu Jan 5 20:25:23 2017 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                         |  2 +-
 .../src/java/org/apache/solr/core/CoreContainer.java     |  5 ++---
 .../src/java/org/apache/solr/core/SolrInfoMBean.java     |  4 ++--
 .../solr/handler/component/HttpShardHandlerFactory.java  |  8 +++++---
 .../java/org/apache/solr/update/UpdateShardHandler.java  | 11 ++++++-----
 .../solr/util/stats/InstrumentedHttpRequestExecutor.java |  2 +-
 .../apache/solr/handler/admin/MetricsHandlerTest.java    |  5 +----
 7 files changed, 18 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e5d28848/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f4dd133..098dfda 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -201,7 +201,7 @@ New Features
 
 * SOLR-9725: Substitute properties into JdbcDataSource configuration ( Jamie Jackson, Yuri
Sashevsky via Mikhail Khludnev)
 
-* SOLR-9877: Use instrumented http client and connection pool. (shalin)
+* SOLR-9877: SOLR-9923: Use instrumented http client and connection pool. (shalin)
 
 * SOLR-9880: Add Ganglia, Graphite and SLF4J metrics reporters. (ab)
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e5d28848/solr/core/src/java/org/apache/solr/core/CoreContainer.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
index de7c34d..8a72617 100644
--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java
+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
@@ -471,11 +471,11 @@ public class CoreContainer {
     shardHandlerFactory = ShardHandlerFactory.newInstance(cfg.getShardHandlerFactoryPluginInfo(),
loader);
     if (shardHandlerFactory instanceof SolrMetricProducer) {
       SolrMetricProducer metricProducer = (SolrMetricProducer) shardHandlerFactory;
-      metricProducer.initializeMetrics(metricManager, SolrInfoMBean.Group.http.toString(),
"httpShardHandler");
+      metricProducer.initializeMetrics(metricManager, SolrInfoMBean.Group.node.toString(),
"httpShardHandler");
     }
 
     updateShardHandler = new UpdateShardHandler(cfg.getUpdateShardHandlerConfig());
-    updateShardHandler.initializeMetrics(metricManager, SolrInfoMBean.Group.http.toString(),
"updateShardHandler");
+    updateShardHandler.initializeMetrics(metricManager, SolrInfoMBean.Group.node.toString(),
"updateShardHandler");
 
     solrCores.allocateLazyCores(cfg.getTransientCacheSize(), loader);
 
@@ -507,7 +507,6 @@ public class CoreContainer {
     metricManager.loadReporters(cfg.getMetricReporterPlugins(), loader, SolrInfoMBean.Group.node);
     metricManager.loadReporters(cfg.getMetricReporterPlugins(), loader, SolrInfoMBean.Group.jvm);
     metricManager.loadReporters(cfg.getMetricReporterPlugins(), loader, SolrInfoMBean.Group.jetty);
-    metricManager.loadReporters(cfg.getMetricReporterPlugins(), loader, SolrInfoMBean.Group.http);
 
     coreConfigService = ConfigSetService.createConfigSetService(cfg, loader, zkSys.zkController);
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e5d28848/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 c64af47..421a4ef 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrInfoMBean.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrInfoMBean.java
@@ -32,12 +32,12 @@ public interface SolrInfoMBean {
   /**
    * Category of {@link SolrCore} component.
    */
-  enum Category { CORE, QUERYHANDLER, UPDATEHANDLER, CACHE, HIGHLIGHTING, QUERYPARSER, SEARCHER,
INDEX, DIRECTORY, OTHER }
+  enum Category { CORE, QUERYHANDLER, UPDATEHANDLER, CACHE, HIGHLIGHTING, QUERYPARSER, SEARCHER,
INDEX, DIRECTORY, HTTP, OTHER }
 
   /**
    * Top-level group of beans for a subsystem.
    */
-  enum Group { jvm, jetty, http, node, core }
+  enum Group { jvm, jetty, node, core }
 
   /**
    * Simple common usage name, e.g. BasicQueryHandler,

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e5d28848/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
index 14af88a..258be97 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
@@ -35,6 +35,7 @@ import org.apache.solr.common.util.StrUtils;
 import org.apache.solr.common.util.URLUtil;
 import org.apache.solr.core.CoreDescriptor;
 import org.apache.solr.core.PluginInfo;
+import org.apache.solr.core.SolrInfoMBean;
 import org.apache.solr.metrics.SolrMetricManager;
 import org.apache.solr.metrics.SolrMetricProducer;
 import org.apache.solr.update.UpdateShardHandlerConfig;
@@ -363,10 +364,11 @@ public class HttpShardHandlerFactory extends ShardHandlerFactory implements
org.
 
   @Override
   public void initializeMetrics(SolrMetricManager manager, String registry, String scope)
{
-    clientConnectionManager.initializeMetrics(manager, registry, scope);
-    httpRequestExecutor.initializeMetrics(manager, registry, scope);
+    String expandedScope = SolrMetricManager.mkName(scope, SolrInfoMBean.Category.HTTP.name());
+    clientConnectionManager.initializeMetrics(manager, registry, expandedScope);
+    httpRequestExecutor.initializeMetrics(manager, registry, expandedScope);
     commExecutor = MetricUtils.instrumentedExecutorService(commExecutor,
         manager.registry(registry),
-        SolrMetricManager.mkName("httpShardExecutor", scope, "threadPool"));
+        SolrMetricManager.mkName("httpShardExecutor", expandedScope, "threadPool"));
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e5d28848/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java b/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java
index cc13f3e..f13cfb5 100644
--- a/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java
+++ b/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java
@@ -98,14 +98,15 @@ public class UpdateShardHandler implements SolrMetricProducer, SolrInfoMBean
{
 
   @Override
   public void initializeMetrics(SolrMetricManager manager, String registry, String scope)
{
-    clientConnectionManager.initializeMetrics(manager, registry, scope);
-    httpRequestExecutor.initializeMetrics(manager, registry, scope);
+    String expandedScope = SolrMetricManager.mkName(scope, getCategory().name());
+    clientConnectionManager.initializeMetrics(manager, registry, expandedScope);
+    httpRequestExecutor.initializeMetrics(manager, registry, expandedScope);
     updateExecutor = new InstrumentedExecutorService(updateExecutor,
         manager.registry(registry),
-        SolrMetricManager.mkName("updateExecutor", scope, "threadPool"));
+        SolrMetricManager.mkName("updateExecutor", expandedScope, "threadPool"));
     recoveryExecutor = new InstrumentedExecutorService(recoveryExecutor,
         manager.registry(registry),
-        SolrMetricManager.mkName("recoveryExecutor", scope, "threadPool"));
+        SolrMetricManager.mkName("recoveryExecutor", expandedScope, "threadPool"));
   }
 
   @Override
@@ -115,7 +116,7 @@ public class UpdateShardHandler implements SolrMetricProducer, SolrInfoMBean
{
 
   @Override
   public Category getCategory() {
-    return null;
+    return Category.HTTP;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e5d28848/solr/core/src/java/org/apache/solr/util/stats/InstrumentedHttpRequestExecutor.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/stats/InstrumentedHttpRequestExecutor.java
b/solr/core/src/java/org/apache/solr/util/stats/InstrumentedHttpRequestExecutor.java
index 6f3f759..91ddd8a 100644
--- a/solr/core/src/java/org/apache/solr/util/stats/InstrumentedHttpRequestExecutor.java
+++ b/solr/core/src/java/org/apache/solr/util/stats/InstrumentedHttpRequestExecutor.java
@@ -44,7 +44,7 @@ public class InstrumentedHttpRequestExecutor extends HttpRequestExecutor
impleme
   protected String scope;
 
   private static String methodNameString(HttpRequest request) {
-    return request.getRequestLine().getMethod().toLowerCase(Locale.ROOT) + "-requests";
+    return request.getRequestLine().getMethod().toLowerCase(Locale.ROOT) + ".requests";
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e5d28848/solr/core/src/test/org/apache/solr/handler/admin/MetricsHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/MetricsHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/MetricsHandlerTest.java
index 67bf0e3..a3e724a 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/MetricsHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/MetricsHandlerTest.java
@@ -42,10 +42,8 @@ public class MetricsHandlerTest extends SolrTestCaseJ4 {
     NamedList values = resp.getValues();
     assertNotNull(values.get("metrics"));
     values = (NamedList) values.get("metrics");
-    System.out.println(values);
     assertNotNull(values.get("solr.jetty"));
     assertNotNull(values.get("solr.jvm"));
-    assertNotNull(values.get("solr.http"));
     assertNotNull(values.get("solr.node"));
     NamedList nl = (NamedList) values.get("solr.core.collection1");
     assertNotNull(nl);
@@ -100,9 +98,8 @@ public class MetricsHandlerTest extends SolrTestCaseJ4 {
     values = resp.getValues();
     assertNotNull(values.get("metrics"));
     values = (NamedList) values.get("metrics");
-    assertEquals(5, values.size());
+    assertEquals(4, values.size());
     assertEquals(0, ((NamedList)values.get("solr.jvm")).size());
-    assertEquals(0, ((NamedList)values.get("solr.http")).size());
     assertEquals(0, ((NamedList)values.get("solr.jetty")).size());
     assertEquals(0, ((NamedList)values.get("solr.core.collection1")).size());
     assertEquals(3, ((NamedList)values.get("solr.node")).size());


Mime
View raw message