lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject lucene-solr:branch_7_5: SOLR-12765: Incorrect format of JMX cache stats.
Date Mon, 17 Sep 2018 13:36:30 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7_5 140c7e193 -> f9b2f0939


SOLR-12765: Incorrect format of JMX cache stats.


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

Branch: refs/heads/branch_7_5
Commit: f9b2f09393557d39216e348b2147808e799be74d
Parents: 140c7e1
Author: Andrzej Bialecki <ab@apache.org>
Authored: Mon Sep 17 14:40:36 2018 +0200
Committer: Andrzej Bialecki <ab@apache.org>
Committed: Mon Sep 17 15:36:22 2018 +0200

----------------------------------------------------------------------
 solr/CHANGES.txt                                          |  2 ++
 .../solr/metrics/reporters/jmx/JmxMetricsReporter.java    | 10 +++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f9b2f093/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index ee9e1b1..05b6820 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -271,6 +271,8 @@ Bug Fixes
 
 * SOLR-12733: SolrMetricReporterTest failure (Erick Erickson, David Smiley)
 
+* SOLR-12765: Incorrect format of JMX cache stats. (Bojan Smid, ab)
+
 Optimizations
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f9b2f093/solr/core/src/java/org/apache/solr/metrics/reporters/jmx/JmxMetricsReporter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/metrics/reporters/jmx/JmxMetricsReporter.java
b/solr/core/src/java/org/apache/solr/metrics/reporters/jmx/JmxMetricsReporter.java
index ebf47e6..f7a0127 100644
--- a/solr/core/src/java/org/apache/solr/metrics/reporters/jmx/JmxMetricsReporter.java
+++ b/solr/core/src/java/org/apache/solr/metrics/reporters/jmx/JmxMetricsReporter.java
@@ -50,6 +50,7 @@ import com.codahale.metrics.ObjectNameFactory;
 import com.codahale.metrics.Reporter;
 import com.codahale.metrics.Timer;
 import org.apache.solr.metrics.MetricsMap;
+import org.apache.solr.metrics.SolrMetricManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -558,9 +559,12 @@ public class JmxMetricsReporter implements Reporter, Closeable {
       try {
         if (filter.matches(name, gauge)) {
           final ObjectName objectName = createName("gauges", name);
-          if (gauge instanceof MetricsMap) {
-            ((MetricsMap)gauge).setAttribute(new Attribute(INSTANCE_TAG, tag));
-            registerMBean(gauge, objectName);
+          if (gauge instanceof SolrMetricManager.GaugeWrapper &&
+              ((SolrMetricManager.GaugeWrapper)gauge).getGauge() instanceof MetricsMap) {
+            MetricsMap mm = (MetricsMap)((SolrMetricManager.GaugeWrapper)gauge).getGauge();
+            mm.setAttribute(new Attribute(INSTANCE_TAG, tag));
+            // don't wrap it in a JmxGauge, it already supports all necessary JMX attributes
+            registerMBean(mm, objectName);
           } else {
             registerMBean(new JmxGauge(gauge, objectName, tag), objectName);
           }


Mime
View raw message