geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [geode] 01/02: GEODE-3619: fix diskTasksWaiting statistic
Date Mon, 18 Sep 2017 21:28:40 GMT
This is an automated email from the ASF dual-hosted git repository.

dschneider pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git

commit adbd50a2df3e52c356915aacf83faec3ad233bf6
Author: Darrel Schneider <dschneider@pivotal.io>
AuthorDate: Thu Sep 14 14:50:14 2017 -0700

    GEODE-3619: fix diskTasksWaiting statistic
    
    Compaction no longer does an extra decrement of the stat.
    Unit test confirms the fix.
---
 .../src/main/java/org/apache/geode/internal/cache/CachePerfStats.java  | 3 +++
 .../src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java   | 1 -
 .../test/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/CachePerfStats.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/CachePerfStats.java
index 59fa5dd..7e0fe22 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/CachePerfStats.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/CachePerfStats.java
@@ -1342,6 +1342,9 @@ public class CachePerfStats {
   public void decDiskTasksWaiting() {
     this.stats.incInt(diskTasksWaitingId, -1);
   }
+  public int getDiskTasksWaiting() {
+    return this.stats.getInt(diskTasksWaitingId);
+  }
 
   public void decDiskTasksWaiting(int count) {
     this.stats.incInt(diskTasksWaitingId, -count);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
index a8a8a53..ac285fe 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
@@ -2832,7 +2832,6 @@ public class DiskStoreImpl implements DiskStore {
      * missed. Notifications need not be sent if the thread is already compaction
      */
     public void run() {
-      getCache().getCachePerfStats().decDiskTasksWaiting();
       if (!this.scheduled)
         return;
       boolean compactedSuccessfully = false;
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java
index 8f6d77b..c7f62ee 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/DiskRegionJUnitTest.java
@@ -2721,6 +2721,8 @@ public class DiskRegionJUnitTest extends DiskRegionTestingBase {
     boolean compacted = ((LocalRegion) region).getDiskStore().forceCompaction();
     assertEquals(true, oplog.testConfirmCompacted());
     assertEquals(true, compacted);
+    CachePerfStats stats = ((InternalCache)cache).getCachePerfStats();
+    assertTrue("expected " + stats.getDiskTasksWaiting() + " to be >= 0", stats.getDiskTasksWaiting()
>= 0);
   }
 
   @Test

-- 
To stop receiving notification emails like this one, please contact
"commits@geode.apache.org" <commits@geode.apache.org>.

Mime
View raw message