ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject ignite git commit: IGNITE-1071 IgniteCache.metrics() method returns local metrics
Date Fri, 25 Mar 2016 09:35:26 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1071 20ae3a21f -> 75711931c


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/75711931
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/75711931
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/75711931

Branch: refs/heads/ignite-1071
Commit: 75711931ca82c11a63d2eed4e27b673a7812c603
Parents: 20ae3a2
Author: Anton Vinogradov <av@apache.org>
Authored: Fri Mar 25 12:35:14 2016 +0300
Committer: Anton Vinogradov <av@apache.org>
Committed: Fri Mar 25 12:35:14 2016 +0300

----------------------------------------------------------------------
 .../cache/GridCacheAbstractMetricsSelfTest.java         | 12 ++++++++++--
 .../GridCacheTransactionalAbstractMetricsSelfTest.java  |  2 +-
 2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/75711931/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 00086a4..bc7d8ec 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
@@ -403,7 +403,7 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
      * @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());
@@ -413,7 +413,15 @@ public abstract class GridCacheAbstractMetricsSelfTest extends GridCacheAbstract
 
         assert cache.metrics().getAveragePutTime() > 0;
 
-        assertEquals(KEY_CNT, cache.metrics().getCachePuts());
+        assertEquals(KEY_CNT, cache.localMetrics().getCachePuts());
+
+        GridTestUtils.waitForCondition(
+            new GridAbsPredicate() {
+                @Override public boolean apply() {
+                    return cache.localMetrics().getCachePuts() == KEY_CNT * 2;
+                }
+            },
+            20_000);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/75711931/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
index 929a45c..b227364 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
@@ -276,7 +276,7 @@ public abstract class GridCacheTransactionalAbstractMetricsSelfTest extends
Grid
 
         for (int i = 0; i < gridCount(); i++) {
             TransactionMetrics metrics = grid(i).transactions().metrics();
-            CacheMetrics cacheMetrics = grid(i).cache(null).metrics();
+            CacheMetrics cacheMetrics = grid(i).cache(null).localMetrics();
 
             assertEquals(0, metrics.txCommits());
             assertEquals(0, cacheMetrics.getCacheTxCommits());


Mime
View raw message