Repository: ignite
Updated Branches:
  refs/heads/master b9c1dbc9b -> 11d8b6687


IGNITE-7685 Incorrect AllocationRate counting

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


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

Branch: refs/heads/master
Commit: 11d8b6687eb48abd783c5202d704564b9ac5b505
Parents: b9c1dbc
Author: Andrey Kuznetsov <stku...@gmail.com>
Authored: Thu Feb 22 17:26:33 2018 +0300
Committer: Anton Vinogradov <a...@apache.org>
Committed: Thu Feb 22 17:26:33 2018 +0300

----------------------------------------------------------------------
 .../processors/cache/persistence/AllocatedPageTracker.java    | 2 ++
 .../processors/cache/persistence/DataRegionMetricsImpl.java   | 7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/11d8b668/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/AllocatedPageTracker.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/AllocatedPageTracker.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/AllocatedPageTracker.java
index 8f3ff68..54aad8d 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/AllocatedPageTracker.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/AllocatedPageTracker.java
@@ -23,6 +23,8 @@ package 
org.apache.ignite.internal.processors.cache.persistence;
 public interface AllocatedPageTracker {
     /**
      * Increments totalAllocatedPages counter.
+     *
+     * @param delta Value to increment by.
      */
     public void updateTotalAllocatedPages(long delta);
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/11d8b668/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DataRegionMetricsImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DataRegionMetricsImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DataRegionMetricsImpl.java
index bc5b32d..7d6b478 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DataRegionMetricsImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DataRegionMetricsImpl.java
@@ -268,15 +268,16 @@ public class DataRegionMetricsImpl implements 
DataRegionMetrics, AllocatedPageTr
         if (metricsEnabled) {
             totalAllocatedPages.add(delta);
 
-            updateAllocationRateMetrics();
+            if (delta > 0)
+                updateAllocationRateMetrics(delta);
         }
     }
 
     /**
      *
      */
-    private void updateAllocationRateMetrics() {
-        allocRate.onHit();
+    private void updateAllocationRateMetrics(long hits) {
+        allocRate.onHits(hits);
     }
 
     /**

Reply via email to