ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [4/7] ignite git commit: IGNITE-6871 Implement new JMX metrics for partitions map monitoring HotFix
Date Tue, 12 Dec 2017 08:26:10 GMT
IGNITE-6871 Implement new JMX metrics for partitions map monitoring HotFix

Signed-off-by: Anton Vinogradov <av@apache.org>


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

Branch: refs/heads/ignite-zk
Commit: b6c0d3d594e91f742971f08854e573d739be6402
Parents: 8da4fc9
Author: Aleksey Plekhanov <plehanov.alex@gmail.com>
Authored: Fri Dec 8 17:22:18 2017 +0300
Committer: Anton Vinogradov <av@apache.org>
Committed: Mon Dec 11 14:09:46 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/CacheGroupMetricsMXBeanImpl.java   |  7 ++++++-
 .../apache/ignite/mxbean/CacheGroupMetricsMXBean.java   | 10 +++++++++-
 .../processors/cache/CacheGroupMetricsMBeanTest.java    | 12 ++++++++++++
 .../processors/cache/CacheValidatorMetricsTest.java     |  5 +++++
 4 files changed, 32 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b6c0d3d5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsMXBeanImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsMXBeanImpl.java
index eb8e7ac..0788ee9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsMXBeanImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsMXBeanImpl.java
@@ -61,11 +61,16 @@ public class CacheGroupMetricsMXBeanImpl implements CacheGroupMetricsMXBean
{
     }
 
     /** {@inheritDoc} */
-    @Override public int getCacheGroupId() {
+    @Override public int getGroupId() {
         return ctx.groupId();
     }
 
     /** {@inheritDoc} */
+    @Override public String getGroupName() {
+        return ctx.name();
+    }
+
+    /** {@inheritDoc} */
     @Override public List<String> getCaches() {
         List<String> caches = new ArrayList<>(ctx.caches().size());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b6c0d3d5/modules/core/src/main/java/org/apache/ignite/mxbean/CacheGroupMetricsMXBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/CacheGroupMetricsMXBean.java
b/modules/core/src/main/java/org/apache/ignite/mxbean/CacheGroupMetricsMXBean.java
index db548a3..46b99b1 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/CacheGroupMetricsMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/CacheGroupMetricsMXBean.java
@@ -33,7 +33,15 @@ public interface CacheGroupMetricsMXBean {
      * @return Cache group id.
      */
     @MXBeanDescription("Cache group id.")
-    public int getCacheGroupId();
+    public int getGroupId();
+
+    /**
+     * Gets cache group name.
+     *
+     * @return Cache group name.
+     */
+    @MXBeanDescription("Cache group name.")
+    public String getGroupName();
 
     /**
      * Gets list of cache names of this cache group.

http://git-wip-us.apache.org/repos/asf/ignite/blob/b6c0d3d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsMBeanTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsMBeanTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsMBeanTest.java
index 4769e63..a50f860 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsMBeanTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsMBeanTest.java
@@ -140,6 +140,11 @@ public class CacheGroupMetricsMBeanTest extends GridCommonAbstractTest
implement
         return cfg;
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+    }
+
     /**
      * Gets CacheGroupMetricsMXBean for given node and group name.
      *
@@ -219,6 +224,13 @@ public class CacheGroupMetricsMBeanTest extends GridCommonAbstractTest
implement
         CacheGroupMetricsMXBean mxBean1Grp1 = mxBean(1, "group1");
         CacheGroupMetricsMXBean mxBean2Grp1 = mxBean(2, "group1");
 
+        assertEquals("group1", mxBean0Grp1.getGroupName());
+        assertEquals(null, mxBean0Grp3.getGroupName());
+
+        assertEquals(3, mxBean0Grp1.getBackups());
+
+        assertEquals(10, mxBean0Grp1.getPartitions());
+
         assertEquals(1, mxBean0Grp1.getMinimumNumberOfPartitionCopies());
         assertEquals(3, mxBean0Grp1.getMaximumNumberOfPartitionCopies());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b6c0d3d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheValidatorMetricsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheValidatorMetricsTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheValidatorMetricsTest.java
index ba3ad5a..5c601a1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheValidatorMetricsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheValidatorMetricsTest.java
@@ -64,6 +64,11 @@ public class CacheValidatorMetricsTest extends GridCommonAbstractTest implements
         return cfg;
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+    }
+
     /**
      * Asserts that the cache has appropriate status (indicated by the cache metrics).
      *


Mime
View raw message