kohlmu-pivotal commented on a change in pull request #7456:
URL: https://github.com/apache/geode/pull/7456#discussion_r833671018



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/control/HeapMemoryMonitor.java
##########
@@ -429,29 +207,33 @@ void setEvictionThreshold(final float evictionThreshold) {
       thresholds = new MemoryThresholds(thresholds.getMaxMemoryBytes(),
           thresholds.getCriticalThreshold(), evictionThreshold);
 
-      updateStateAndSendEvent();
-
-      // Start or stop monitoring based upon whether a threshold has been set
-      if (thresholds.isEvictionThresholdEnabled()
-          || thresholds.isCriticalThresholdEnabled()) {
-        startMonitoring();
-      } else if (!thresholds.isEvictionThresholdEnabled()
-          && !thresholds.isCriticalThresholdEnabled()) {
-        stopMonitoring();
-      }
+      handleThresholdChange();
 
       stats.changeEvictionThreshold(thresholds.getEvictionThresholdBytes());
     }
   }
 
+  private void handleThresholdChange() {
+    updateStateAndSendEvent();
+
+    // Start or stop monitoring based upon whether a threshold has been set
+    if (thresholds.isEvictionThresholdEnabled()
+        || thresholds.isCriticalThresholdEnabled()) {
+      startMonitoring();
+    } else if (!thresholds.isEvictionThresholdEnabled()
+        && !thresholds.isCriticalThresholdEnabled()) {
+      stopMonitoring();
+    }
+  }
+
   /**
    * Compare the number of bytes used (fetched from the JVM) to the 
thresholds. If necessary, change
    * the state and send an event for the state change.
    */
   public void updateStateAndSendEvent() {
     updateStateAndSendEvent(
         testBytesUsedForThresholdSet != -1 ? testBytesUsedForThresholdSet : 
getBytesUsed(),
-        "notification");
+        "product-check");

Review comment:
       Ok, that makes sense.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to