You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/12/16 16:10:04 UTC

[GitHub] merlimat closed pull request #3199: Use direct memory instead of Heap to determine a broker is "overloaded" in memory usage

merlimat closed pull request #3199: Use direct memory instead of Heap to determine a broker is "overloaded" in memory usage
URL: https://github.com/apache/pulsar/pull/3199
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java
index 023ce3b1a3..9f9b949b71 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java
@@ -355,7 +355,7 @@ public ZooKeeperChildrenCache getActiveBrokersCache() {
     public Set<String> getAvailableBrokers() throws Exception {
         return this.availableActiveBrokers.get();
     }
-    
+
     public ZooKeeperDataCache<LoadReport> getLoadReportCache() {
         return this.loadReportCacheZk;
     }
@@ -1062,13 +1062,15 @@ private void updateRanking() {
     public static boolean isAboveLoadLevel(SystemResourceUsage usage, float thresholdPercentage) {
         return (usage.bandwidthOut.percentUsage() > thresholdPercentage
                 || usage.bandwidthIn.percentUsage() > thresholdPercentage
-                || usage.cpu.percentUsage() > thresholdPercentage || usage.memory.percentUsage() > thresholdPercentage);
+                || usage.cpu.percentUsage() > thresholdPercentage
+                || usage.directMemory.percentUsage() > thresholdPercentage);
     }
 
     public static boolean isBelowLoadLevel(SystemResourceUsage usage, float thresholdPercentage) {
         return (usage.bandwidthOut.percentUsage() < thresholdPercentage
                 && usage.bandwidthIn.percentUsage() < thresholdPercentage
-                && usage.cpu.percentUsage() < thresholdPercentage && usage.memory.percentUsage() < thresholdPercentage);
+                && usage.cpu.percentUsage() < thresholdPercentage
+                && usage.directMemory.percentUsage() < thresholdPercentage);
     }
 
     private static long getRealtimeJvmHeapUsageMBytes() {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services