ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [5/8] ignite git commit: IGNITE-1071 IgniteCache.metrics() method returns local metrics
Date Tue, 29 Mar 2016 07:14:16 GMT
IGNITE-1071 IgniteCache.metrics() method returns local metrics


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

Branch: refs/heads/ignite-1786
Commit: f17b2ae0ea150a2803584f80276ada527db54b5a
Parents: 134f26e
Author: Anton Vinogradov <av@apache.org>
Authored: Mon Mar 28 19:19:26 2016 +0300
Committer: Anton Vinogradov <av@apache.org>
Committed: Mon Mar 28 19:34:29 2016 +0300

----------------------------------------------------------------------
 .../rest/RestBinaryProtocolSelfTest.java        |   4 +-
 .../rest/RestMemcacheProtocolSelfTest.java      |   4 +-
 .../java/org/apache/ignite/IgniteCache.java     |  20 +-
 .../discovery/GridDiscoveryManager.java         |   2 +-
 .../cache/CacheClusterMetricsMXBeanImpl.java    | 410 +++++++++++++++++++
 .../cache/CacheLocalMetricsMXBeanImpl.java      | 410 +++++++++++++++++++
 .../cache/CacheMetricsMXBeanImpl.java           | 410 -------------------
 .../processors/cache/GridCacheAdapter.java      |  43 +-
 .../processors/cache/GridCacheProcessor.java    |  12 +-
 .../processors/cache/GridCacheProxyImpl.java    |  45 +-
 .../processors/cache/IgniteCacheProxy.java      |  39 +-
 .../processors/cache/IgniteInternalCache.java   |  31 +-
 .../platform/cache/PlatformCache.java           |   2 +-
 .../handlers/cache/GridCacheCommandHandler.java |   2 +-
 .../internal/visor/cache/VisorCacheMetrics.java |   2 +-
 .../visor/cache/VisorCacheResetMetricsTask.java |   2 +-
 .../CacheMetricsForClusterGroupSelfTest.java    |   2 +-
 .../cache/CacheSwapUnswapGetTest.java           |   4 +-
 .../cache/GridCacheAbstractMetricsSelfTest.java | 124 +++---
 .../GridCacheOffHeapValuesEvictionSelfTest.java |  18 +-
 ...cheTransactionalAbstractMetricsSelfTest.java |   4 +-
 .../dht/GridCacheColocatedDebugTest.java        |   2 +-
 ...ePartitionedNearDisabledMetricsSelfTest.java |   2 +-
 ...AtomicPartitionedTckMetricsSelfTestImpl.java |  92 ++---
 .../near/GridCacheNearMetricsSelfTest.java      | 152 +++----
 ...idCachePartitionedHitsAndMissesSelfTest.java |   2 +-
 ...CacheLocalOffHeapAndSwapMetricsSelfTest.java | 380 ++++++++---------
 ...dCacheAtomicLocalTckMetricsSelfTestImpl.java |  92 ++---
 .../multijvm/IgniteCacheProcessProxy.java       |   8 +
 29 files changed, 1431 insertions(+), 889 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java
index 7629afb..251e184 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestBinaryProtocolSelfTest.java
@@ -412,9 +412,9 @@ public class RestBinaryProtocolSelfTest extends GridCommonAbstractTest {
         IgniteCache<Object, Object> jcacheDft = grid().cache(null);
         IgniteCache<Object, Object> jcacheName = grid().cache(CACHE_NAME);
 
-        jcacheDft.mxBean().clear();
+        jcacheDft.localMxBean().clear();
 
-        jcacheName.mxBean().clear();
+        jcacheName.localMxBean().clear();
 
         jcacheDft.put("key1", "val");
         jcacheDft.put("key2", "val");

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java
index fbaee9e..2797387 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/RestMemcacheProtocolSelfTest.java
@@ -205,8 +205,8 @@ public class RestMemcacheProtocolSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testMetrics() throws Exception {
-        grid().cache(null).mxBean().clear();
-        grid().cache(CACHE_NAME).mxBean().clear();
+        grid().cache(null).localMxBean().clear();
+        grid().cache(CACHE_NAME).localMxBean().clear();
 
         grid().cache(null).put("key1", "val");
         grid().cache(null).put("key2", "val");

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index a791e38..581f091 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -715,14 +715,14 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
     public IgniteFuture<?> rebalance();
 
     /**
-     * Gets snapshot metrics (statistics) for this cache.
+     * Gets whole cluster snapshot metrics (statistics) for this cache.
      *
      * @return Cache metrics.
      */
     public CacheMetrics metrics();
 
     /**
-     * Gets snapshot metrics for caches in cluster group.
+     * Gets cluster group snapshot metrics for caches in cluster group.
      *
      * @param grp Cluster group.
      * @return Cache metrics.
@@ -730,9 +730,23 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
     public CacheMetrics metrics(ClusterGroup grp);
 
     /**
-     * Gets MxBean for this cache.
+     * Gets local snapshot metrics (statistics) for this cache.
+     *
+     * @return Cache metrics.
+     */
+    public CacheMetrics localMetrics();
+
+    /**
+     * Gets whole cluster MxBean for this cache.
      *
      * @return MxBean.
      */
     public CacheMetricsMXBean mxBean();
+
+    /**
+     * Gets local MxBean for this cache.
+     *
+     * @return MxBean.
+     */
+    public CacheMetricsMXBean localMxBean();
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 7b795d5..a254b73 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -908,7 +908,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
                         if (metrics == null)
                             metrics = U.newHashMap(caches.size());
 
-                        metrics.put(cache.context().cacheId(), cache.metrics());
+                        metrics.put(cache.context().cacheId(), cache.localMetrics());
                     }
                 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
new file mode 100644
index 0000000..519d07b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
@@ -0,0 +1,410 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.mxbean.CacheMetricsMXBean;
+
+/**
+ * Management bean that provides access to {@link IgniteCache IgniteCache}.
+ */
+class CacheClusterMetricsMXBeanImpl implements CacheMetricsMXBean {
+    /** Cache. */
+    private GridCacheAdapter<?, ?> cache;
+
+    /**
+     * Creates MBean;
+     *
+     * @param cache Cache.
+     */
+    CacheClusterMetricsMXBeanImpl(GridCacheAdapter<?, ?> cache) {
+        assert cache != null;
+
+        this.cache = cache;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String name() {
+        return cache.clusterMetrics().name();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOverflowSize() {
+        return cache.clusterMetrics().getOverflowSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapGets() {
+        return cache.clusterMetrics().getOffHeapGets();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapPuts() {
+        return cache.clusterMetrics().getOffHeapPuts();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapRemovals() {
+        return cache.clusterMetrics().getOffHeapRemovals();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapEvictions() {
+        return cache.clusterMetrics().getOffHeapEvictions();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapHits() {
+        return cache.clusterMetrics().getOffHeapHits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getOffHeapHitPercentage() {
+        return cache.clusterMetrics().getOffHeapHitPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapMisses() {
+        return cache.clusterMetrics().getOffHeapMisses();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getOffHeapMissPercentage() {
+        return cache.clusterMetrics().getOffHeapMissPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapEntriesCount() {
+        return cache.clusterMetrics().getOffHeapEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapPrimaryEntriesCount() {
+        return cache.clusterMetrics().getOffHeapPrimaryEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapBackupEntriesCount() {
+        return cache.clusterMetrics().getOffHeapBackupEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapAllocatedSize() {
+        return cache.clusterMetrics().getOffHeapAllocatedSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapMaxSize() {
+        return cache.clusterMetrics().getOffHeapMaxSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapGets() {
+        return cache.clusterMetrics().getSwapGets();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapPuts() {
+        return cache.clusterMetrics().getSwapPuts();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapRemovals() {
+        return cache.clusterMetrics().getSwapRemovals();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapHits() {
+        return cache.clusterMetrics().getSwapHits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapMisses() {
+        return cache.clusterMetrics().getSwapMisses();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getSwapHitPercentage() {
+        return cache.clusterMetrics().getSwapHitPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getSwapMissPercentage() {
+        return cache.clusterMetrics().getSwapMissPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapEntriesCount() {
+        return cache.clusterMetrics().getSwapEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapSize() {
+        return cache.clusterMetrics().getSwapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getSize() {
+        return cache.clusterMetrics().getSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getKeySize() {
+        return cache.clusterMetrics().getKeySize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return cache.clusterMetrics().isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getDhtEvictQueueCurrentSize() {
+        return cache.clusterMetrics().getDhtEvictQueueCurrentSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxCommitQueueSize() {
+        return cache.clusterMetrics().getTxCommitQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxThreadMapSize() {
+        return cache.clusterMetrics().getTxThreadMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxXidMapSize() {
+        return cache.clusterMetrics().getTxXidMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxPrepareQueueSize() {
+        return cache.clusterMetrics().getTxPrepareQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxStartVersionCountsSize() {
+        return cache.clusterMetrics().getTxStartVersionCountsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxCommittedVersionsSize() {
+        return cache.clusterMetrics().getTxCommittedVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxRolledbackVersionsSize() {
+        return cache.clusterMetrics().getTxRolledbackVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtThreadMapSize() {
+        return cache.clusterMetrics().getTxDhtThreadMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtXidMapSize() {
+        return cache.clusterMetrics().getTxDhtXidMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtCommitQueueSize() {
+        return cache.clusterMetrics().getTxDhtCommitQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtPrepareQueueSize() {
+        return cache.clusterMetrics().getTxDhtPrepareQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtStartVersionCountsSize() {
+        return cache.clusterMetrics().getTxDhtStartVersionCountsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtCommittedVersionsSize() {
+        return cache.clusterMetrics().getTxDhtCommittedVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtRolledbackVersionsSize() {
+        return cache.clusterMetrics().getTxDhtRolledbackVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isWriteBehindEnabled() {
+        return cache.clusterMetrics().isWriteBehindEnabled();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindFlushSize() {
+        return cache.clusterMetrics().getWriteBehindFlushSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindFlushThreadCount() {
+        return cache.clusterMetrics().getWriteBehindFlushThreadCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getWriteBehindFlushFrequency() {
+        return cache.clusterMetrics().getWriteBehindFlushFrequency();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindStoreBatchSize() {
+        return cache.clusterMetrics().getWriteBehindStoreBatchSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindTotalCriticalOverflowCount() {
+        return cache.clusterMetrics().getWriteBehindTotalCriticalOverflowCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindCriticalOverflowCount() {
+        return cache.clusterMetrics().getWriteBehindCriticalOverflowCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindErrorRetryCount() {
+        return cache.clusterMetrics().getWriteBehindErrorRetryCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindBufferSize() {
+        return cache.clusterMetrics().getWriteBehindBufferSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void clear() {
+        throw new UnsupportedOperationException("Cluster metrics can't be cleared. Use local metrics clear instead.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheHits() {
+        return cache.clusterMetrics().getCacheHits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getCacheHitPercentage() {
+        return cache.clusterMetrics().getCacheHitPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheMisses() {
+        return cache.clusterMetrics().getCacheMisses();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getCacheMissPercentage() {
+        return cache.clusterMetrics().getCacheMissPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheGets() {
+        return cache.clusterMetrics().getCacheGets();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCachePuts() {
+        return cache.clusterMetrics().getCachePuts();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheRemovals() {
+        return cache.clusterMetrics().getCacheRemovals();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheEvictions() {
+        return cache.clusterMetrics().getCacheEvictions();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageGetTime() {
+        return cache.clusterMetrics().getAverageGetTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAveragePutTime() {
+        return cache.clusterMetrics().getAveragePutTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageRemoveTime() {
+        return cache.clusterMetrics().getAverageRemoveTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageTxCommitTime() {
+        return cache.clusterMetrics().getAverageTxCommitTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageTxRollbackTime() {
+        return cache.clusterMetrics().getAverageTxRollbackTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheTxCommits() {
+        return cache.clusterMetrics().getCacheTxCommits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheTxRollbacks() {
+        return cache.clusterMetrics().getCacheTxRollbacks();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String getKeyType() {
+        return cache.clusterMetrics().getKeyType();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String getValueType() {
+        return cache.clusterMetrics().getValueType();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isStoreByValue() {
+        return cache.clusterMetrics().isStoreByValue();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isStatisticsEnabled() {
+        return cache.clusterMetrics().isStatisticsEnabled();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isManagementEnabled() {
+        return cache.clusterMetrics().isManagementEnabled();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isReadThrough() {
+        return cache.clusterMetrics().isReadThrough();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isWriteThrough() {
+        return cache.clusterMetrics().isWriteThrough();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
new file mode 100644
index 0000000..5284ca0
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
@@ -0,0 +1,410 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.mxbean.CacheMetricsMXBean;
+
+/**
+ * Management bean that provides access to {@link IgniteCache IgniteCache}.
+ */
+class CacheLocalMetricsMXBeanImpl implements CacheMetricsMXBean {
+    /** Cache. */
+    private GridCacheAdapter<?, ?> cache;
+
+    /**
+     * Creates MBean;
+     *
+     * @param cache Cache.
+     */
+    CacheLocalMetricsMXBeanImpl(GridCacheAdapter<?, ?> cache) {
+        assert cache != null;
+
+        this.cache = cache;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String name() {
+        return cache.metrics0().name();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOverflowSize() {
+        return cache.metrics0().getOverflowSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapGets() {
+        return cache.metrics0().getOffHeapGets();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapPuts() {
+        return cache.metrics0().getOffHeapPuts();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapRemovals() {
+        return cache.metrics0().getOffHeapRemovals();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapEvictions() {
+        return cache.metrics0().getOffHeapEvictions();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapHits() {
+        return cache.metrics0().getOffHeapHits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getOffHeapHitPercentage() {
+        return cache.metrics0().getOffHeapHitPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapMisses() {
+        return cache.metrics0().getOffHeapMisses();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getOffHeapMissPercentage() {
+        return cache.metrics0().getOffHeapMissPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapEntriesCount() {
+        return cache.metrics0().getOffHeapEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapPrimaryEntriesCount() {
+        return cache.metrics0().getOffHeapPrimaryEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapBackupEntriesCount() {
+        return cache.metrics0().getOffHeapBackupEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapAllocatedSize() {
+        return cache.metrics0().getOffHeapAllocatedSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getOffHeapMaxSize() {
+        return cache.metrics0().getOffHeapMaxSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapGets() {
+        return cache.metrics0().getSwapGets();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapPuts() {
+        return cache.metrics0().getSwapPuts();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapRemovals() {
+        return cache.metrics0().getSwapRemovals();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapHits() {
+        return cache.metrics0().getSwapHits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapMisses() {
+        return cache.metrics0().getSwapMisses();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getSwapHitPercentage() {
+        return cache.metrics0().getSwapHitPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getSwapMissPercentage() {
+        return cache.metrics0().getSwapMissPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapEntriesCount() {
+        return cache.metrics0().getSwapEntriesCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getSwapSize() {
+        return cache.metrics0().getSwapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getSize() {
+        return cache.metrics0().getSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getKeySize() {
+        return cache.metrics0().getKeySize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isEmpty() {
+        return cache.metrics0().isEmpty();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getDhtEvictQueueCurrentSize() {
+        return cache.metrics0().getDhtEvictQueueCurrentSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxCommitQueueSize() {
+        return cache.metrics0().getTxCommitQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxThreadMapSize() {
+        return cache.metrics0().getTxThreadMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxXidMapSize() {
+        return cache.metrics0().getTxXidMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxPrepareQueueSize() {
+        return cache.metrics0().getTxPrepareQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxStartVersionCountsSize() {
+        return cache.metrics0().getTxStartVersionCountsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxCommittedVersionsSize() {
+        return cache.metrics0().getTxCommittedVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxRolledbackVersionsSize() {
+        return cache.metrics0().getTxRolledbackVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtThreadMapSize() {
+        return cache.metrics0().getTxDhtThreadMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtXidMapSize() {
+        return cache.metrics0().getTxDhtXidMapSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtCommitQueueSize() {
+        return cache.metrics0().getTxDhtCommitQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtPrepareQueueSize() {
+        return cache.metrics0().getTxDhtPrepareQueueSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtStartVersionCountsSize() {
+        return cache.metrics0().getTxDhtStartVersionCountsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtCommittedVersionsSize() {
+        return cache.metrics0().getTxDhtCommittedVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getTxDhtRolledbackVersionsSize() {
+        return cache.metrics0().getTxDhtRolledbackVersionsSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isWriteBehindEnabled() {
+        return cache.metrics0().isWriteBehindEnabled();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindFlushSize() {
+        return cache.metrics0().getWriteBehindFlushSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindFlushThreadCount() {
+        return cache.metrics0().getWriteBehindFlushThreadCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getWriteBehindFlushFrequency() {
+        return cache.metrics0().getWriteBehindFlushFrequency();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindStoreBatchSize() {
+        return cache.metrics0().getWriteBehindStoreBatchSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindTotalCriticalOverflowCount() {
+        return cache.metrics0().getWriteBehindTotalCriticalOverflowCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindCriticalOverflowCount() {
+        return cache.metrics0().getWriteBehindCriticalOverflowCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindErrorRetryCount() {
+        return cache.metrics0().getWriteBehindErrorRetryCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getWriteBehindBufferSize() {
+        return cache.metrics0().getWriteBehindBufferSize();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void clear() {
+        cache.metrics0().clear();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheHits() {
+        return cache.metrics0().getCacheHits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getCacheHitPercentage() {
+        return cache.metrics0().getCacheHitPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheMisses() {
+        return cache.metrics0().getCacheMisses();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getCacheMissPercentage() {
+        return cache.metrics0().getCacheMissPercentage();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheGets() {
+        return cache.metrics0().getCacheGets();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCachePuts() {
+        return cache.metrics0().getCachePuts();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheRemovals() {
+        return cache.metrics0().getCacheRemovals();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheEvictions() {
+        return cache.metrics0().getCacheEvictions();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageGetTime() {
+        return cache.metrics0().getAverageGetTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAveragePutTime() {
+        return cache.metrics0().getAveragePutTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageRemoveTime() {
+        return cache.metrics0().getAverageRemoveTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageTxCommitTime() {
+        return cache.metrics0().getAverageTxCommitTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public float getAverageTxRollbackTime() {
+        return cache.metrics0().getAverageTxRollbackTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheTxCommits() {
+        return cache.metrics0().getCacheTxCommits();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getCacheTxRollbacks() {
+        return cache.metrics0().getCacheTxRollbacks();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String getKeyType() {
+        return cache.metrics0().getKeyType();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String getValueType() {
+        return cache.metrics0().getValueType();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isStoreByValue() {
+        return cache.metrics0().isStoreByValue();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isStatisticsEnabled() {
+        return cache.metrics0().isStatisticsEnabled();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isManagementEnabled() {
+        return cache.metrics0().isManagementEnabled();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isReadThrough() {
+        return cache.metrics0().isReadThrough();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean isWriteThrough() {
+        return cache.metrics0().isWriteThrough();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
deleted file mode 100644
index 822240e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsMXBeanImpl.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.mxbean.CacheMetricsMXBean;
-
-/**
- * Management bean that provides access to {@link IgniteCache IgniteCache}.
- */
-class CacheMetricsMXBeanImpl implements CacheMetricsMXBean {
-    /** Cache. */
-    private GridCacheAdapter<?, ?> cache;
-
-    /**
-     * Creates MBean;
-     *
-     * @param cache Cache.
-     */
-    CacheMetricsMXBeanImpl(GridCacheAdapter<?, ?> cache) {
-        assert cache != null;
-
-        this.cache = cache;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String name() {
-        return cache.metrics0().name();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOverflowSize() {
-        return cache.metrics0().getOverflowSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapGets() {
-        return cache.metrics0().getOffHeapGets();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapPuts() {
-        return cache.metrics0().getOffHeapPuts();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapRemovals() {
-        return cache.metrics0().getOffHeapRemovals();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapEvictions() {
-        return cache.metrics0().getOffHeapEvictions();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapHits() {
-        return cache.metrics0().getOffHeapHits();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getOffHeapHitPercentage() {
-        return cache.metrics0().getOffHeapHitPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapMisses() {
-        return cache.metrics0().getOffHeapMisses();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getOffHeapMissPercentage() {
-        return cache.metrics0().getOffHeapMissPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapEntriesCount() {
-        return cache.metrics0().getOffHeapEntriesCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapPrimaryEntriesCount() {
-        return cache.metrics0().getOffHeapPrimaryEntriesCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapBackupEntriesCount() {
-        return cache.metrics0().getOffHeapBackupEntriesCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapAllocatedSize() {
-        return cache.metrics0().getOffHeapAllocatedSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapMaxSize() {
-        return cache.metrics0().getOffHeapMaxSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapGets() {
-        return cache.metrics0().getSwapGets();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapPuts() {
-        return cache.metrics0().getSwapPuts();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapRemovals() {
-        return cache.metrics0().getSwapRemovals();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapHits() {
-        return cache.metrics0().getSwapHits();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapMisses() {
-        return cache.metrics0().getSwapMisses();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getSwapHitPercentage() {
-        return cache.metrics0().getSwapHitPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getSwapMissPercentage() {
-        return cache.metrics0().getSwapMissPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapEntriesCount() {
-        return cache.metrics0().getSwapEntriesCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getSwapSize() {
-        return cache.metrics0().getSwapSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getSize() {
-        return cache.metrics0().getSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getKeySize() {
-        return cache.metrics0().getKeySize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isEmpty() {
-        return cache.metrics0().isEmpty();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getDhtEvictQueueCurrentSize() {
-        return cache.metrics0().getDhtEvictQueueCurrentSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxCommitQueueSize() {
-        return cache.metrics0().getTxCommitQueueSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxThreadMapSize() {
-        return cache.metrics0().getTxThreadMapSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxXidMapSize() {
-        return cache.metrics0().getTxXidMapSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxPrepareQueueSize() {
-        return cache.metrics0().getTxPrepareQueueSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxStartVersionCountsSize() {
-        return cache.metrics0().getTxStartVersionCountsSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxCommittedVersionsSize() {
-        return cache.metrics0().getTxCommittedVersionsSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxRolledbackVersionsSize() {
-        return cache.metrics0().getTxRolledbackVersionsSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtThreadMapSize() {
-        return cache.metrics0().getTxDhtThreadMapSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtXidMapSize() {
-        return cache.metrics0().getTxDhtXidMapSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtCommitQueueSize() {
-        return cache.metrics0().getTxDhtCommitQueueSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtPrepareQueueSize() {
-        return cache.metrics0().getTxDhtPrepareQueueSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtStartVersionCountsSize() {
-        return cache.metrics0().getTxDhtStartVersionCountsSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtCommittedVersionsSize() {
-        return cache.metrics0().getTxDhtCommittedVersionsSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getTxDhtRolledbackVersionsSize() {
-        return cache.metrics0().getTxDhtRolledbackVersionsSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isWriteBehindEnabled() {
-        return cache.metrics0().isWriteBehindEnabled();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindFlushSize() {
-        return cache.metrics0().getWriteBehindFlushSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindFlushThreadCount() {
-        return cache.metrics0().getWriteBehindFlushThreadCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getWriteBehindFlushFrequency() {
-        return cache.metrics0().getWriteBehindFlushFrequency();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindStoreBatchSize() {
-        return cache.metrics0().getWriteBehindStoreBatchSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindTotalCriticalOverflowCount() {
-        return cache.metrics0().getWriteBehindTotalCriticalOverflowCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindCriticalOverflowCount() {
-        return cache.metrics0().getWriteBehindCriticalOverflowCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindErrorRetryCount() {
-        return cache.metrics0().getWriteBehindErrorRetryCount();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getWriteBehindBufferSize() {
-        return cache.metrics0().getWriteBehindBufferSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void clear() {
-        cache.metrics0().clear();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheHits() {
-        return cache.metrics0().getCacheHits();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getCacheHitPercentage() {
-        return cache.metrics0().getCacheHitPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheMisses() {
-        return cache.metrics0().getCacheMisses();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getCacheMissPercentage() {
-        return cache.metrics0().getCacheMissPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheGets() {
-        return cache.metrics0().getCacheGets();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCachePuts() {
-        return cache.metrics0().getCachePuts();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheRemovals() {
-        return cache.metrics0().getCacheRemovals();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheEvictions() {
-        return cache.metrics0().getCacheEvictions();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getAverageGetTime() {
-        return cache.metrics0().getAverageGetTime();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getAveragePutTime() {
-        return cache.metrics0().getAveragePutTime();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getAverageRemoveTime() {
-        return cache.metrics0().getAverageRemoveTime();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getAverageTxCommitTime() {
-        return cache.metrics0().getAverageTxCommitTime();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getAverageTxRollbackTime() {
-        return cache.metrics0().getAverageTxRollbackTime();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheTxCommits() {
-        return cache.metrics0().getCacheTxCommits();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCacheTxRollbacks() {
-        return cache.metrics0().getCacheTxRollbacks();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getKeyType() {
-        return cache.metrics0().getKeyType();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getValueType() {
-        return cache.metrics0().getValueType();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isStoreByValue() {
-        return cache.metrics0().isStoreByValue();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isStatisticsEnabled() {
-        return cache.metrics0().isStatisticsEnabled();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isManagementEnabled() {
-        return cache.metrics0().isManagementEnabled();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isReadThrough() {
-        return cache.metrics0().isReadThrough();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isWriteThrough() {
-        return cache.metrics0().isWriteThrough();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index a1f0f28..44c8b57 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -137,6 +137,7 @@ import org.apache.ignite.mxbean.CacheMetricsMXBean;
 import org.apache.ignite.plugin.security.SecurityPermission;
 import org.apache.ignite.resources.IgniteInstanceResource;
 import org.apache.ignite.resources.JobContextResource;
+import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
 import org.apache.ignite.transactions.Transaction;
 import org.apache.ignite.transactions.TransactionConcurrency;
 import org.apache.ignite.transactions.TransactionIsolation;
@@ -253,8 +254,11 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
     /** Cache metrics. */
     protected CacheMetricsImpl metrics;
 
+    /** Cache localMxBean. */
+    protected CacheMetricsMXBean localMxBean;
+
     /** Cache mxBean. */
-    protected CacheMetricsMXBean mxBean;
+    protected CacheMetricsMXBean clusterMxBean;
 
     /** Logger. */
     protected IgniteLogger log;
@@ -324,7 +328,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
         metrics = new CacheMetricsImpl(ctx);
 
-        mxBean = new CacheMetricsMXBeanImpl(this);
+        localMxBean = new CacheLocalMetricsMXBeanImpl(this);
+        clusterMxBean = new CacheClusterMetricsMXBeanImpl(this);
 
         FileSystemConfiguration[] igfsCfgs = gridCfg.getFileSystemConfiguration();
 
@@ -3294,13 +3299,41 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
     }
 
     /** {@inheritDoc} */
-    @Override public CacheMetrics metrics() {
+    @Override public CacheMetrics clusterMetrics() {
+        return clusterMetrics(ctx.grid().cluster().forCacheNodes(ctx.name()));
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheMetrics clusterMetrics(ClusterGroup grp) {
+        List<CacheMetrics> metrics = new ArrayList<>(grp.nodes().size());
+
+        for (ClusterNode node : grp.nodes()) {
+            Map<Integer, CacheMetrics> nodeCacheMetrics = ((TcpDiscoveryNode)node).cacheMetrics();
+
+            if (nodeCacheMetrics != null) {
+                CacheMetrics e = nodeCacheMetrics.get(context().cacheId());
+
+                if (e != null)
+                    metrics.add(e);
+            }
+        }
+
+        return new CacheMetricsSnapshot(ctx.cache().localMetrics(), metrics);
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheMetrics localMetrics() {
         return new CacheMetricsSnapshot(metrics);
     }
 
     /** {@inheritDoc} */
-    @Override public CacheMetricsMXBean mxBean() {
-        return mxBean;
+    @Override public CacheMetricsMXBean localMxBean() {
+        return localMxBean;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheMetricsMXBean clusterMxBean() {
+        return clusterMxBean;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index f5ebc0d..67d6a6c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -549,8 +549,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         cleanup(cfg, cfg.getAffinityMapper(), false);
         cleanup(cfg, cctx.store().configuredStore(), false);
 
-        if (!CU.isUtilityCache(cfg.getName()) && !CU.isSystemCache(cfg.getName()))
-            unregisterMbean(cctx.cache().mxBean(), cfg.getName(), false);
+        if (!CU.isUtilityCache(cfg.getName()) && !CU.isSystemCache(cfg.getName())) {
+            unregisterMbean(cctx.cache().localMxBean(), cfg.getName(), false);
+            unregisterMbean(cctx.cache().clusterMxBean(), cfg.getName(), false);
+        }
 
         NearCacheConfiguration nearCfg = cfg.getNearConfiguration();
 
@@ -1488,8 +1490,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             cacheCtx.cache(dht);
         }
 
-        if (!CU.isUtilityCache(cache.name()) && !CU.isSystemCache(cache.name()))
-            registerMbean(cache.mxBean(), cache.name(), false);
+        if (!CU.isUtilityCache(cache.name()) && !CU.isSystemCache(cache.name())) {
+            registerMbean(cache.localMxBean(), cache.name(), false);
+            registerMbean(cache.clusterMxBean(), cache.name(), false);
+        }
 
         return ret;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index 9b4aff3..cbe16c6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -35,6 +35,7 @@ import org.apache.ignite.cache.CacheEntry;
 import org.apache.ignite.cache.CacheMetrics;
 import org.apache.ignite.cache.CachePeekMode;
 import org.apache.ignite.cache.affinity.Affinity;
+import org.apache.ignite.cluster.ClusterGroup;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
@@ -143,16 +144,52 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
     }
 
     /** {@inheritDoc} */
+    @Override public CacheMetrics clusterMetrics() {
+        CacheOperationContext prev = gate.enter(opCtx);
+
+        try {
+            return delegate.clusterMetrics();
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheMetrics clusterMetrics(ClusterGroup grp) {
+        CacheOperationContext prev = gate.enter(opCtx);
+
+        try {
+            return delegate.clusterMetrics(grp);
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
     @Override public CacheConfiguration configuration() {
         return delegate.configuration();
     }
 
     /** {@inheritDoc} */
-    @Override public CacheMetrics metrics() {
+    @Override public CacheMetrics localMetrics() {
+        CacheOperationContext prev = gate.enter(opCtx);
+
+        try {
+            return delegate.localMetrics();
+        }
+        finally {
+            gate.leave(prev);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheMetricsMXBean clusterMxBean() {
         CacheOperationContext prev = gate.enter(opCtx);
 
         try {
-            return delegate.metrics();
+            return delegate.clusterMxBean();
         }
         finally {
             gate.leave(prev);
@@ -160,11 +197,11 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
     }
 
     /** {@inheritDoc} */
-    @Override public CacheMetricsMXBean mxBean() {
+    @Override public CacheMetricsMXBean localMxBean() {
         CacheOperationContext prev = gate.enter(opCtx);
 
         try {
-            return delegate.mxBean();
+            return delegate.localMxBean();
         }
         finally {
             gate.leave(prev);

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 6e8bcbf..5b78271 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -222,7 +222,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
         CacheOperationContext prev = onEnter(gate, opCtx);
 
         try {
-            return ctx.cache().metrics();
+            return ctx.cache().clusterMetrics();
         }
         finally {
             onLeave(gate, prev);
@@ -236,20 +236,20 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
         CacheOperationContext prev = onEnter(gate, opCtx);
 
         try {
-            List<CacheMetrics> metrics = new ArrayList<>(grp.nodes().size());
-
-            for (ClusterNode node : grp.nodes()) {
-                Map<Integer, CacheMetrics> nodeCacheMetrics = ((TcpDiscoveryNode)node).cacheMetrics();
+            return ctx.cache().clusterMetrics(grp);
+        }
+        finally {
+            onLeave(gate, prev);
+        }
+    }
 
-                if (nodeCacheMetrics != null) {
-                    CacheMetrics e = nodeCacheMetrics.get(context().cacheId());
+    @Override public CacheMetrics localMetrics() {
+        GridCacheGateway<K, V> gate = this.gate;
 
-                    if (e != null)
-                        metrics.add(e);
-                }
-            }
+        CacheOperationContext prev = onEnter(gate, opCtx);
 
-            return new CacheMetricsSnapshot(ctx.cache().metrics(), metrics);
+        try {
+            return ctx.cache().localMetrics();
         }
         finally {
             onLeave(gate, prev);
@@ -263,7 +263,20 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
         CacheOperationContext prev = onEnter(gate, opCtx);
 
         try {
-            return ctx.cache().mxBean();
+            return ctx.cache().clusterMxBean();
+        }
+        finally {
+            onLeave(gate, prev);
+        }
+    }
+
+    @Override public CacheMetricsMXBean localMxBean() {
+        GridCacheGateway<K, V> gate = this.gate;
+
+        CacheOperationContext prev = onEnter(gate, opCtx);
+
+        try {
+            return ctx.cache().localMxBean();
         }
         finally {
             onLeave(gate, prev);

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index 68d0f06..d2e0101 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -38,6 +38,7 @@ import org.apache.ignite.cache.CachePeekMode;
 import org.apache.ignite.cache.affinity.Affinity;
 import org.apache.ignite.cache.affinity.AffinityKeyMapped;
 import org.apache.ignite.cache.store.CacheStore;
+import org.apache.ignite.cluster.ClusterGroup;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteInternalFuture;
@@ -1543,18 +1544,40 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
     public Affinity<K> affinity();
 
     /**
-     * Gets metrics (statistics) for this cache.
+     * Gets whole cluster metrics (statistics) for this cache.
      *
      * @return Cache metrics.
      */
-    public CacheMetrics metrics();
+    public CacheMetrics clusterMetrics();
 
     /**
-     * Gets metrics (statistics) for this cache.
+     * Gets cluster group metrics (statistics) for this cache.
      *
+     * @param grp Cluster group.
      * @return Cache metrics.
      */
-    public CacheMetricsMXBean mxBean();
+    public CacheMetrics clusterMetrics(ClusterGroup grp);
+
+    /**
+     * Gets local metrics (statistics) for this cache.
+     *
+     * @return Cache metrics.
+     */
+    public CacheMetrics localMetrics();
+
+    /**
+     * Gets whole cluster metrics (statistics) for this cache.
+     *
+     * @return Cache metrics.
+     */
+    public CacheMetricsMXBean clusterMxBean();
+
+    /**
+     * Gets local metrics (statistics) for this cache.
+     *
+     * @return Cache metrics.
+     */
+    public CacheMetricsMXBean localMxBean();
 
     /**
      * Gets size (in bytes) of all entries swapped to disk.

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
index 35ccd19..75683a8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
@@ -482,7 +482,7 @@ public class PlatformCache extends PlatformAbstractTarget {
                 break;
 
             case OP_METRICS:
-                CacheMetrics metrics = cache.metrics();
+                CacheMetrics metrics = cache.localMetrics();
 
                 writer.writeLong(metrics.getCacheGets());
                 writer.writeLong(metrics.getCachePuts());

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
index a89913f..85611de 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
@@ -1486,7 +1486,7 @@ public class GridCacheCommandHandler extends GridRestCommandHandlerAdapter {
 
         /** {@inheritDoc} */
         @Override public IgniteInternalFuture<?> applyx(IgniteInternalCache<Object, Object> c, GridKernalContext ctx) {
-            CacheMetrics metrics = c.cache().metrics();
+            CacheMetrics metrics = c.cache().localMetrics();
 
             assert metrics != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
index 1a88813..0a77dc4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
@@ -179,7 +179,7 @@ public class VisorCacheMetrics implements Serializable {
         mode = cacheProcessor.cacheMode(cacheName);
         sys = cacheProcessor.systemCache(cacheName);
 
-        CacheMetrics m = c.metrics();
+        CacheMetrics m = c.localMetrics();
 
         size = m.getSize();
         keySize = m.getKeySize();

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
index 9ff4dae..ccec241 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
@@ -56,7 +56,7 @@ public class VisorCacheResetMetricsTask extends VisorOneNodeTask<String, Void> {
             IgniteInternalCache cache = ignite.cachex(cacheName);
 
             if (cache != null)
-                cache.mxBean().clear();
+                cache.localMxBean().clear();
 
             return null;
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
index c0075ad..9c24feb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMetricsForClusterGroupSelfTest.java
@@ -213,7 +213,7 @@ public class CacheMetricsForClusterGroupSelfTest extends GridCommonAbstractTest
             CacheMetrics metrics = cache.metrics(grid(i).cluster().forCacheNodes(cache.getName()));
 
             for (int j = 0; j < GRID_CNT; j++)
-                ms[j] = grid(j).cache(cache.getName()).metrics();
+                ms[j] = grid(j).cache(cache.getName()).localMetrics();
 
             // Static metrics
             for (int j = 0; j < GRID_CNT; j++)

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java
index 214beb6..7fe1f34 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSwapUnswapGetTest.java
@@ -264,7 +264,7 @@ public class CacheSwapUnswapGetTest extends GridCommonAbstractTest {
                     ", offheap=" + cache.localSize(CachePeekMode.OFFHEAP) +
                     ", swap=" + cache.localSize(CachePeekMode.SWAP) +
                     ", total=" + cache.localSize() +
-                    ", offheapMem=" + cache.metrics().getOffHeapAllocatedSize() + ']');
+                    ", offheapMem=" + cache.localMetrics().getOffHeapAllocatedSize() + ']');
             }
 
             done.set(true);
@@ -282,7 +282,7 @@ public class CacheSwapUnswapGetTest extends GridCommonAbstractTest {
             int offheapSize = cache.localSize(CachePeekMode.OFFHEAP);
             int swapSize = cache.localSize(CachePeekMode.SWAP);
             int total = cache.localSize();
-            long offheapMem = cache.metrics().getOffHeapAllocatedSize();
+            long offheapMem = cache.localMetrics().getOffHeapAllocatedSize();
 
             log.info("Cache size [heap=" + onheapSize +
                 ", offheap=" + offheapSize +

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
index 4c04df0..13bd081 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractMetricsSelfTest.java
@@ -97,7 +97,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         for (int i = 0; i < gridCount(); i++) {
             Ignite g = grid(i);
 
-            g.cache(null).mxBean().clear();
+            g.cache(null).localMxBean().clear();
 
             g.transactions().resetMetrics();
         }
@@ -141,7 +141,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         // Assert that statistics is clear.
         for (int i = 0; i < gridCount(); i++) {
-            CacheMetrics m = grid(i).cache(null).metrics();
+            CacheMetrics m = grid(i).cache(null).localMetrics();
 
             assertEquals(m.getCacheGets(), 0);
             assertEquals(m.getCachePuts(), 0);
@@ -162,7 +162,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testGetMetricsSnapshot() throws Exception {
         IgniteCache<Object, Object> cache = grid(0).cache(null);
 
-        assertNotSame("Method metrics() should return snapshot.", cache.metrics(), cache.metrics());
+        assertNotSame("Method metrics() should return snapshot.", cache.localMetrics(), cache.localMetrics());
     }
 
     /**
@@ -176,7 +176,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         for (int i = 0; i < KEY_CNT; i++)
             cache.put(i, i);
 
-        assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+        assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
 
         for (int i = 0; i < KEY_CNT; i++) {
             cacheAsync.getAndRemove(i);
@@ -186,7 +186,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             fut.get();
         }
 
-        assert cache.metrics().getAverageRemoveTime() > 0;
+        assert cache.localMetrics().getAverageRemoveTime() > 0;
     }
 
     /**
@@ -206,7 +206,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             }
         }
 
-        assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+        assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
 
         cache.put(key, key);
 
@@ -216,7 +216,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         assertTrue(fut.get());
 
-        assert cache.metrics().getAverageRemoveTime() >= 0;
+        assert cache.localMetrics().getAverageRemoveTime() >= 0;
     }
 
     /**
@@ -228,12 +228,12 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         for (int i = 0; i < KEY_CNT; i++)
             cache.put(i, i);
 
-        assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+        assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
 
         for (int i = 0; i < KEY_CNT; i++)
             cache.remove(i);
 
-        assert cache.metrics().getAverageRemoveTime() > 0;
+        assert cache.localMetrics().getAverageRemoveTime() > 0;
     }
 
     /**
@@ -246,7 +246,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         cache.put(2, 2);
         cache.put(3, 3);
 
-        assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+        assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
 
         Set<Integer> keys = new HashSet<>(4, 1);
         keys.add(1);
@@ -255,7 +255,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         cache.removeAll(keys);
 
-        float averageRemoveTime = cache.metrics().getAverageRemoveTime();
+        float averageRemoveTime = cache.localMetrics().getAverageRemoveTime();
 
         assert averageRemoveTime >= 0;
     }
@@ -280,7 +280,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             }
         }
 
-        assertEquals(cache.metrics().getAverageRemoveTime(), 0.0, 0.0);
+        assertEquals(cache.localMetrics().getAverageRemoveTime(), 0.0, 0.0);
 
         cacheAsync.removeAll(keys);
 
@@ -288,7 +288,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         fut.get();
 
-        assert cache.metrics().getAverageRemoveTime() >= 0;
+        assert cache.localMetrics().getAverageRemoveTime() >= 0;
     }
 
 
@@ -300,17 +300,17 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         cache.put(1, 1);
 
-        assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
         cache.get(1);
 
-        float averageGetTime = cache.metrics().getAverageGetTime();
+        float averageGetTime = cache.localMetrics().getAverageGetTime();
 
         assert averageGetTime > 0;
 
         cache.get(2);
 
-        assert cache.metrics().getAverageGetTime() > 0;
+        assert cache.localMetrics().getAverageGetTime() > 0;
     }
 
     /**
@@ -319,13 +319,13 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testGetAllAvgTime() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).cache(null);
 
-        assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
         cache.put(1, 1);
         cache.put(2, 2);
         cache.put(3, 3);
 
-        assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
         Set<Integer> keys = new TreeSet<>();
         keys.add(1);
@@ -334,7 +334,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         cache.getAll(keys);
 
-        assert cache.metrics().getAverageGetTime() > 0;
+        assert cache.localMetrics().getAverageGetTime() > 0;
     }
 
     /**
@@ -344,13 +344,13 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         IgniteCache<Object, Object> cache = grid(0).cache(null);
         IgniteCache<Object, Object> cacheAsync = cache.withAsync();
 
-        assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
         cache.put(1, 1);
         cache.put(2, 2);
         cache.put(3, 3);
 
-        assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
         Set<Integer> keys = new TreeSet<>();
         keys.add(1);
@@ -365,24 +365,24 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         TimeUnit.MILLISECONDS.sleep(100L);
 
-        assert cache.metrics().getAverageGetTime() > 0;
+        assert cache.localMetrics().getAverageGetTime() > 0;
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testPutAvgTime() throws Exception {
-        IgniteCache<Integer, Integer> cache = grid(0).cache(null);
+        final IgniteCache<Integer, Integer> cache = grid(0).cache(null);
 
-        assertEquals(0.0, cache.metrics().getAveragePutTime(), 0.0);
-        assertEquals(0, cache.metrics().getCachePuts());
+        assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
+        assertEquals(0, cache.localMetrics().getCachePuts());
 
         for (int i = 0; i < KEY_CNT; i++)
             cache.put(i, i);
 
-        assert cache.metrics().getAveragePutTime() > 0;
+        assert cache.localMetrics().getAveragePutTime() > 0;
 
-        assertEquals(KEY_CNT, cache.metrics().getCachePuts());
+        assertEquals(KEY_CNT, cache.localMetrics().getCachePuts());
     }
 
     /**
@@ -392,8 +392,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         IgniteCache<Object, Object> cache = grid(0).cache(null);
         IgniteCache<Object, Object> cacheAsync = cache.withAsync();
 
-        assertEquals(0.0, cache.metrics().getAveragePutTime(), 0.0);
-        assertEquals(0, cache.metrics().getCachePuts());
+        assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
+        assertEquals(0, cache.localMetrics().getCachePuts());
 
         cacheAsync.put(1, 1);
 
@@ -401,7 +401,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         TimeUnit.MILLISECONDS.sleep(100L);
 
-        assert cache.metrics().getAveragePutTime() > 0;
+        assert cache.localMetrics().getAveragePutTime() > 0;
     }
 
     /**
@@ -421,8 +421,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             }
         }
 
-        assertEquals(0.0, cache.metrics().getAveragePutTime(), 0.0);
-        assertEquals(0.0, cache.metrics().getAverageGetTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
+        assertEquals(0.0, cache.localMetrics().getAverageGetTime(), 0.0);
 
         cacheAsync.getAndPut(key, key);
 
@@ -432,8 +432,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         TimeUnit.MILLISECONDS.sleep(100L);
 
-        assert cache.metrics().getAveragePutTime() > 0;
-        assert cache.metrics().getAverageGetTime() > 0;
+        assert cache.localMetrics().getAveragePutTime() > 0;
+        assert cache.localMetrics().getAverageGetTime() > 0;
     }
 
     /**
@@ -453,7 +453,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             }
         }
 
-        assertEquals(0.0f, cache.metrics().getAveragePutTime());
+        assertEquals(0.0f, cache.localMetrics().getAveragePutTime());
 
         cacheAsync.putIfAbsent(key, key);
 
@@ -463,7 +463,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         TimeUnit.MILLISECONDS.sleep(100L);
 
-        assert cache.metrics().getAveragePutTime() > 0;
+        assert cache.localMetrics().getAveragePutTime() > 0;
     }
 
     /**
@@ -483,7 +483,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             }
         }
 
-        assertEquals(0.0f, cache.metrics().getAveragePutTime());
+        assertEquals(0.0f, cache.localMetrics().getAveragePutTime());
 
         cacheAsync.getAndPutIfAbsent(key, key);
 
@@ -493,7 +493,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         TimeUnit.MILLISECONDS.sleep(100L);
 
-        assert cache.metrics().getAveragePutTime() > 0;
+        assert cache.localMetrics().getAveragePutTime() > 0;
     }
 
     /**
@@ -502,8 +502,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testPutAllAvgTime() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).cache(null);
 
-        assertEquals(0.0, cache.metrics().getAveragePutTime(), 0.0);
-        assertEquals(0, cache.metrics().getCachePuts());
+        assertEquals(0.0, cache.localMetrics().getAveragePutTime(), 0.0);
+        assertEquals(0, cache.localMetrics().getCachePuts());
 
         Map<Integer, Integer> values = new HashMap<>();
 
@@ -513,10 +513,10 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         cache.putAll(values);
 
-        float averagePutTime = cache.metrics().getAveragePutTime();
+        float averagePutTime = cache.localMetrics().getAveragePutTime();
 
         assert averagePutTime >= 0;
-        assertEquals(values.size(), cache.metrics().getCachePuts());
+        assertEquals(values.size(), cache.localMetrics().getCachePuts());
     }
 
     /**
@@ -539,12 +539,12 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
             expReads += expectedReadsPerPut(isPrimary);
             expMisses += expectedMissesPerPut(isPrimary);
 
-            info("Puts: " + cache0.metrics().getCachePuts());
+            info("Puts: " + cache0.localMetrics().getCachePuts());
 
             for (int j = 0; j < gridCount(); j++) {
                 IgniteCache<Integer, Integer> cache = grid(j).cache(null);
 
-                int cacheWrites = (int)cache.metrics().getCachePuts();
+                int cacheWrites = (int)cache.localMetrics().getCachePuts();
 
                 assertEquals("Wrong cache metrics [i=" + i + ", grid=" + j + ']', i + 1, cacheWrites);
             }
@@ -561,7 +561,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         int misses = 0;
 
         for (int i = 0; i < gridCount(); i++) {
-            CacheMetrics m = grid(i).cache(null).metrics();
+            CacheMetrics m = grid(i).cache(null).localMetrics();
 
             puts += m.getCachePuts();
             reads += m.getCacheGets();
@@ -583,18 +583,18 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testMissHitPercentage() throws Exception {
         IgniteCache<Integer, Integer> cache0 = grid(0).cache(null);
 
-        int keyCnt = keyCount();
+        final int keyCnt = keyCount();
 
         // Put and get a few keys.
         for (int i = 0; i < keyCnt; i++) {
             cache0.getAndPut(i, i); // +1 read
 
-            info("Puts: " + cache0.metrics().getCachePuts());
+            info("Puts: " + cache0.localMetrics().getCachePuts());
 
             for (int j = 0; j < gridCount(); j++) {
                 IgniteCache<Integer, Integer> cache = grid(j).cache(null);
 
-                long cacheWrites = cache.metrics().getCachePuts();
+                long cacheWrites = cache.localMetrics().getCachePuts();
 
                 assertEquals("Wrong cache metrics [i=" + i + ", grid=" + j + ']', i + 1, cacheWrites);
             }
@@ -604,7 +604,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         // Check metrics for the whole cache.
         for (int i = 0; i < gridCount(); i++) {
-            CacheMetrics m = grid(i).cache(null).metrics();
+            CacheMetrics m = grid(i).cache(null).localMetrics();
 
             assertEquals(m.getCacheHits() * 100f / m.getCacheGets(), m.getCacheHitPercentage(), 0.1f);
             assertEquals(m.getCacheMisses() * 100f / m.getCacheGets(), m.getCacheMissPercentage(), 0.1f);
@@ -639,7 +639,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         long misses = 0;
 
         for (int i = 0; i < gridCount(); i++) {
-            CacheMetrics m = grid(i).cache(null).metrics();
+            CacheMetrics m = grid(i).cache(null).localMetrics();
 
             puts += m.getCachePuts();
             reads += m.getCacheGets();
@@ -659,8 +659,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
     public void testMissesOnEmptyCache() throws Exception {
         IgniteCache<Integer, Integer> cache = grid(0).cache(null);
 
-        assertEquals("Expected 0 read", 0, cache.metrics().getCacheGets());
-        assertEquals("Expected 0 miss", 0, cache.metrics().getCacheMisses());
+        assertEquals("Expected 0 read", 0, cache.localMetrics().getCacheGets());
+        assertEquals("Expected 0 miss", 0, cache.localMetrics().getCacheMisses());
 
         Integer key =  null;
 
@@ -676,19 +676,19 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         cache.get(key);
 
-        assertEquals("Expected 1 read", 1, cache.metrics().getCacheGets());
-        assertEquals("Expected 1 miss", 1, cache.metrics().getCacheMisses());
+        assertEquals("Expected 1 read", 1, cache.localMetrics().getCacheGets());
+        assertEquals("Expected 1 miss", 1, cache.localMetrics().getCacheMisses());
 
         cache.getAndPut(key, key); // +1 read, +1 miss.
 
-        assertEquals("Expected 2 reads", 2, cache.metrics().getCacheGets());
+        assertEquals("Expected 2 reads", 2, cache.localMetrics().getCacheGets());
 
         cache.get(key);
 
-        assertEquals("Expected 1 write", 1, cache.metrics().getCachePuts());
-        assertEquals("Expected 3 reads", 3, cache.metrics().getCacheGets());
-        assertEquals("Expected 2 misses", 2, cache.metrics().getCacheMisses());
-        assertEquals("Expected 1 hit", 1, cache.metrics().getCacheHits());
+        assertEquals("Expected 1 write", 1, cache.localMetrics().getCachePuts());
+        assertEquals("Expected 3 reads", 3, cache.localMetrics().getCacheGets());
+        assertEquals("Expected 2 misses", 2, cache.localMetrics().getCacheMisses());
+        assertEquals("Expected 1 hit", 1, cache.localMetrics().getCacheHits());
     }
 
     /**
@@ -702,7 +702,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
         // +1 remove
         cache.remove(1);
 
-        assertEquals(1L, cache.metrics().getCacheRemovals());
+        assertEquals(1L, cache.localMetrics().getCacheRemovals());
     }
 
     /**
@@ -718,8 +718,8 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         cache.localEvict(Collections.singleton(1));
 
-        assertEquals(0L, cache.metrics().getCacheRemovals());
-        assertEquals(1L, cache.metrics().getCacheEvictions());
+        assertEquals(0L, cache.localMetrics().getCacheRemovals());
+        assertEquals(1L, cache.localMetrics().getCacheEvictions());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/f17b2ae0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java
index a3cc785..108ee90 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapValuesEvictionSelfTest.java
@@ -103,9 +103,9 @@ public class GridCacheOffHeapValuesEvictionSelfTest extends GridCacheAbstractSel
         assertTrue(MAX_VALS_AMOUNT - 5 <= cache.size(CachePeekMode.ONHEAP));
         assertEquals(cache.size(CachePeekMode.ALL) - cache.size(CachePeekMode.ONHEAP), cache.size(CachePeekMode.SWAP));
 
-        assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.metrics().getOffHeapAllocatedSize());
-        assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.metrics().getOffHeapAllocatedSize());
-        assertTrue(cache.metrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.ONHEAP) * VAL_SIZE);
+        assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.localMetrics().getOffHeapAllocatedSize());
+        assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.localMetrics().getOffHeapAllocatedSize());
+        assertTrue(cache.localMetrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.ONHEAP) * VAL_SIZE);
     }
 
     /**
@@ -143,9 +143,9 @@ public class GridCacheOffHeapValuesEvictionSelfTest extends GridCacheAbstractSel
         assertEquals(cache.size(CachePeekMode.ALL) - cache.size(CachePeekMode.ONHEAP) - cache.size(CachePeekMode.OFFHEAP),
             cache.size(CachePeekMode.SWAP));
 
-        assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.metrics().getOffHeapAllocatedSize());
-        assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.metrics().getOffHeapAllocatedSize());
-        assertTrue(cache.metrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.OFFHEAP) * VAL_SIZE);
+        assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.localMetrics().getOffHeapAllocatedSize());
+        assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.localMetrics().getOffHeapAllocatedSize());
+        assertTrue(cache.localMetrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.OFFHEAP) * VAL_SIZE);
     }
 
     /**
@@ -181,9 +181,9 @@ public class GridCacheOffHeapValuesEvictionSelfTest extends GridCacheAbstractSel
         assertTrue(MAX_VALS_AMOUNT >= cache.size(CachePeekMode.OFFHEAP));
         assertTrue(MAX_VALS_AMOUNT - 5 <= cache.size(CachePeekMode.OFFHEAP));
 
-        assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.metrics().getOffHeapAllocatedSize());
-        assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.metrics().getOffHeapAllocatedSize());
-        assertTrue(cache.metrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.OFFHEAP) * VAL_SIZE);
+        assertTrue((MAX_VALS_AMOUNT + 5) * VAL_SIZE > cache.localMetrics().getOffHeapAllocatedSize());
+        assertTrue((MAX_VALS_AMOUNT - 5) * VAL_SIZE < cache.localMetrics().getOffHeapAllocatedSize());
+        assertTrue(cache.localMetrics().getOffHeapAllocatedSize() >= cache.size(CachePeekMode.OFFHEAP) * VAL_SIZE);
     }
 
     /** Fill cache with values. */


Mime
View raw message