geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject incubator-geode git commit: GEODE-581: Measuring event queue size without using the stat for gfsh
Date Thu, 17 Dec 2015 02:38:24 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-681 [created] db113e626


GEODE-581: Measuring event queue size without using the stat for gfsh

The eventQueueSize stat has issues with concurrent events during start
and stop that are leading it to be inaccurate. To make gfsh and jmx
correct,  measuring the queue size directly from the underlying region
size.


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

Branch: refs/heads/feature/GEODE-681
Commit: db113e6262d16f3f409ed772d632d8c967a8a70b
Parents: fdec70b
Author: Dan Smith <upthewaterspout@apache.org>
Authored: Wed Dec 9 16:22:32 2015 -0800
Committer: Dan Smith <upthewaterspout@apache.org>
Committed: Wed Dec 16 18:32:26 2015 -0800

----------------------------------------------------------------------
 .../gemfire/internal/cache/wan/AbstractGatewaySender.java   | 5 +++++
 .../cache/wan/AbstractGatewaySenderEventProcessor.java      | 8 ++++++--
 .../cache/wan/parallel/ParallelGatewaySenderQueue.java      | 2 +-
 .../serial/ConcurrentSerialGatewaySenderEventProcessor.java | 9 +++++++++
 .../management/internal/beans/GatewaySenderMBeanBridge.java | 2 +-
 .../gemfire/management/internal/beans/stats/StatsKey.java   | 1 -
 6 files changed, 22 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db113e62/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractGatewaySender.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractGatewaySender.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractGatewaySender.java
index 422c150..ac6f0ad 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractGatewaySender.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractGatewaySender.java
@@ -1249,6 +1249,11 @@ public abstract class AbstractGatewaySender implements GatewaySender,
     return 0;
   }
   
+  public int getEventQueueSize() { 
+    AbstractGatewaySenderEventProcessor localProcessor = this.eventProcessor;
+    return localProcessor == null ? 0 : localProcessor.eventQueueSize();
+  }
+
   public void setEnqueuedAllTempQueueEvents(boolean enqueuedAllTempQueueEvents) {
     this.enqueuedAllTempQueueEvents = enqueuedAllTempQueueEvents;
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db113e62/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractGatewaySenderEventProcessor.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractGatewaySenderEventProcessor.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractGatewaySenderEventProcessor.java
index b9d877e..c19857f 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractGatewaySenderEventProcessor.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/AbstractGatewaySenderEventProcessor.java
@@ -244,8 +244,12 @@ public abstract class AbstractGatewaySenderEventProcessor extends Thread
{
     //return this.queue.take();
   }
 
-  protected int eventQueueSize() {
-    // This should be local size instead of PR size. Fix for #48627
+  public int eventQueueSize() {
+    if(queue == null) {
+      return 0;
+    }
+    
+    // This should be local size instead of pr size
     if (this.queue instanceof ParallelGatewaySenderQueue) {
       return ((ParallelGatewaySenderQueue) queue).localSize();
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db113e62/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index 94dc9e8..429ddaa 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -1414,7 +1414,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
   public int localSize() {
     int size = 0;
     for (PartitionedRegion prQ : this.userRegionNameToshadowPRMap.values()) {
-      if(((PartitionedRegion)prQ.getRegion()).getDataStore() != null) {
+      if(prQ != null && ((PartitionedRegion)prQ.getRegion()).getDataStore() != null)
{
         size += ((PartitionedRegion)prQ.getRegion()).getDataStore()
             .getSizeOfLocalPrimaryBuckets();  
       }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db113e62/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/serial/ConcurrentSerialGatewaySenderEventProcessor.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/serial/ConcurrentSerialGatewaySenderEventProcessor.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/serial/ConcurrentSerialGatewaySenderEventProcessor.java
index 16410ce..1f68c55 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/serial/ConcurrentSerialGatewaySenderEventProcessor.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/serial/ConcurrentSerialGatewaySenderEventProcessor.java
@@ -100,6 +100,15 @@ public class ConcurrentSerialGatewaySenderEventProcessor extends
       }
     }
   }
+  
+  @Override
+  public int eventQueueSize() {
+    int size = 0;
+    for (RegionQueue queue : queues) {
+      size += queue.size();
+    }
+    return size;
+  }
 
   //based on the fix for old wan Bug#46992 .revision is 39437  
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db113e62/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/GatewaySenderMBeanBridge.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/GatewaySenderMBeanBridge.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/GatewaySenderMBeanBridge.java
index 0b6f432..82767e0 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/GatewaySenderMBeanBridge.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/GatewaySenderMBeanBridge.java
@@ -253,7 +253,7 @@ public class GatewaySenderMBeanBridge {
   }  
 
   public int getEventQueueSize() {
-    return getStatistic(StatsKey.GATEWAYSENDER_EVENTS_QUEUE_SIZE).intValue();
+    return abstractSender.getEventQueueSize();
   }
 
   public float getEventsQueuedRate() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db113e62/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/stats/StatsKey.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/stats/StatsKey.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/stats/StatsKey.java
index 5097292..05dfd5e 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/stats/StatsKey.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/stats/StatsKey.java
@@ -301,7 +301,6 @@ public class StatsKey {
   
   public static final String GATEWAYSENDER_EVENTS_RECEIVED = "eventsReceived";
   public static final String GATEWAYSENDER_EVENTS_QUEUED = "eventsQueued";
-  public static final String GATEWAYSENDER_EVENTS_QUEUE_SIZE = "eventQueueSize";
   public static final String GATEWAYSENDER_BATCHES_DISTRIBUTED = "batchesDistributed";
   public static final String GATEWAYSENDER_BATCHES_DISTRIBUTE_TIME = "batchDistributionTime";
   public static final String GATEWAYSENDER_TOTAL_BATCHES_REDISTRIBUTED = "batchesRedistributed";


Mime
View raw message