refactoring of SystemLoad calls (only one backend tool)

pull/1/head
Michael Peter Christen 11 years ago
parent a37d067692
commit 17e0956312

@ -178,14 +178,6 @@ public class MemoryControl {
public static void setProperMbyte(final long mbyte) {
getStrategy().setProperMbyte(mbyte);
}
/**
* get the system load within the last minute
* @return the system load or a negative number if the load is not available
*/
public static double load() {
return ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();
}
/**
* main

@ -26,8 +26,8 @@ package net.yacy.kelondro.workflow;
import java.net.SocketException;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.Memory;
import net.yacy.kelondro.util.MemoryControl;
@ -178,8 +178,8 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT
ratz(this.idlePause);
idletime += System.currentTimeMillis() - timestamp;
//} else if ((memnow = serverMemory.available()) > memprereq) try {
} else if (MemoryControl.load() > loadprereq) {
logSystem("Thread '" + this.getName() + "' runs high load cycle. current: " + MemoryControl.load() + " max.: " + loadprereq);
} else if (Memory.load() > loadprereq) {
logSystem("Thread '" + this.getName() + "' runs high load cycle. current: " + Memory.load() + " max.: " + loadprereq);
timestamp = System.currentTimeMillis();
ratz(this.idlePause);
idletime += System.currentTimeMillis() - timestamp;

Loading…
Cancel
Save