geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject geode git commit: GEODE-1027: RegionMBean shows incorrect values after server restart
Date Tue, 06 Dec 2016 21:50:47 GMT
Repository: geode
Updated Branches:
  refs/heads/develop 03dfde706 -> c8603efcd


GEODE-1027: RegionMBean shows incorrect values after server restart


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

Branch: refs/heads/develop
Commit: c8603efcd7c0d82f16a94f607dcd2c58a3ec4696
Parents: 03dfde7
Author: Jens Deppe <jdeppe@pivotal.io>
Authored: Fri Mar 18 14:45:18 2016 -0700
Committer: Kirk Lund <klund@apache.org>
Committed: Tue Dec 6 13:50:37 2016 -0800

----------------------------------------------------------------------
 .../management/internal/beans/stats/MBeanStatsMonitor.java    | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/c8603efc/geode-core/src/main/java/org/apache/geode/management/internal/beans/stats/MBeanStatsMonitor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/stats/MBeanStatsMonitor.java
b/geode-core/src/main/java/org/apache/geode/management/internal/beans/stats/MBeanStatsMonitor.java
index 50d025a..390fb89 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/stats/MBeanStatsMonitor.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/stats/MBeanStatsMonitor.java
@@ -19,6 +19,7 @@ import java.util.Map;
 
 import org.apache.geode.StatisticDescriptor;
 import org.apache.geode.Statistics;
+import org.apache.geode.StatisticsType;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.i18n.LogWriterI18n;
 import org.apache.geode.internal.statistics.StatisticId;
@@ -55,6 +56,12 @@ public class MBeanStatsMonitor implements StatisticsListener {
 
   public void addStatisticsToMonitor(Statistics stats) {
     monitor.addListener(this);// if already listener is added this will be a no-op
+    // Initialize the stats with the current values.
+    StatisticsType type = stats.getType();
+    StatisticDescriptor[] descriptors = type.getStatistics();
+    for (StatisticDescriptor d : descriptors) {
+      statsMap.put(d.getName(), stats.get(d));
+    }
     monitor.addStatistics(stats);
   }
 


Mime
View raw message