This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new e2408ef  Use direct memory instead of Heap to determine a broker is 
"overloaded" in memory usage (#3199)
e2408ef is described below

commit e2408efb46c327bc2df77bda167e233a734f7319
Author: Matteo Merli <mme...@apache.org>
AuthorDate: Sun Dec 16 08:10:02 2018 -0800

    Use direct memory instead of Heap to determine a broker is "overloaded" in 
memory usage (#3199)
---
 .../pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java     | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

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 023ce3b..9f9b949 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 class SimpleLoadManagerImpl implements LoadManager, 
ZooKeeperCacheListene
     public Set<String> getAvailableBrokers() throws Exception {
         return this.availableActiveBrokers.get();
     }
-    
+
     public ZooKeeperDataCache<LoadReport> getLoadReportCache() {
         return this.loadReportCacheZk;
     }
@@ -1062,13 +1062,15 @@ public class SimpleLoadManagerImpl implements 
LoadManager, ZooKeeperCacheListene
     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() {

Reply via email to