Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

- fixed a display problem in watch crawler - another small enhancement in balancer

orbiter61f9dbf0cc67
diff --git a/htroot/api/status_p.java b/htroot/api/status_p.java
index c55fdd406..27e719570 100644
--- a/htroot/api/status_p.java
+++ b/htroot/api/status_p.java
@@ -21,16 +21,11 @@ public class status_p {
prop.setLocalized(false);
prop.put("rejected", "0");
sb.updateMySeed();
- final int cacheSize = sb.webIndex.index().getBufferSize();
- final long cacheMaxSize = sb.getConfigLong(plasmaSwitchboardConstants.WORDCACHE_MAX_COUNT, 10000);
+ final int cacheMaxSize = (int) sb.getConfigLong(plasmaSwitchboardConstants.WORDCACHE_MAX_COUNT, 10000);
prop.putNum("ppm", sb.currentPPM());
prop.putNum("qpm", sb.webIndex.peers().mySeed().getQPM());
- prop.putNum("wordCacheSize", sb.webIndex.index().getBufferSize());
- prop.putNum("wordCacheSize", cacheSize);
- prop.putNum("wordCacheMaxSize", cacheMaxSize);
- prop.put("wordCacheCount", cacheSize);
- prop.put("wordCacheMaxCount", cacheMaxSize);
-
+ prop.put("wordCacheSize", Integer.toString(sb.webIndex.index().getBufferSize()));
+ prop.put("wordCacheMaxSize", Integer.toString(cacheMaxSize));
//
// memory usage and system attributes
prop.putNum("freeMemory", MemoryControl.free());
diff --git a/htroot/api/status_p.xml b/htroot/api/status_p.xml
index 550efc2dd..1142d73d8 100644
--- a/htroot/api/status_p.xml
+++ b/htroot/api/status_p.xml
@@ -2,9 +2,7 @@
<status>
<ppm>#[ppm]#</ppm>
<wordCacheSize>#[wordCacheSize]#</wordCacheSize>
- <wordCacheSize>#[wordCacheSize]#</wordCacheSize>
- <wordCacheCount>#[wordCacheCount]#</wordCacheCount>
- <wordCacheMaxCount>#[wordCacheMaxCount]#</wordCacheMaxCount>
+ <wordCacheMaxSize>#[wordCacheMaxSize]#</wordCacheMaxSize>
<memory>
<free>#[freeMemory]#</free>
diff --git a/htroot/js/WatchCrawler.js b/htroot/js/WatchCrawler.js
index 0cca57daa..f4ff0053d 100644
--- a/htroot/js/WatchCrawler.js
+++ b/htroot/js/WatchCrawler.js
@@ -91,9 +91,7 @@ function handleStatus(){
removeAllChildren(trafCrawlerSpan);
trafCrawlerSpan.appendChild(document.createTextNode(Math.round((trafficCrawler) / 1024 / 10.24) / 100));
- var wordCache=getValue(getFirstChild(statusTag, "wordCacheCount"));
var wordCacheSize=getValue(getFirstChild(statusTag, "wordCacheSize"));
- var wordCacheMax=getValue(getFirstChild(statusTag, "wordCacheMaxCount"));
var wordCacheMaxSize=getValue(getFirstChild(statusTag, "wordCacheMaxSize"));
wordCacheNum=document.getElementById("wordcacheNum");
@@ -103,7 +101,7 @@ function handleStatus(){
wordCacheSpan=document.getElementById("wordcacheSpan");
removeAllChildren(wordCacheSpan);
var img;
- var percent=Math.round(wordCache/wordCacheMax*100);
+ var percent=Math.round(wordCacheSize/wordCacheMaxSize*100);
for(i=0;i<percent*WORDCACHEBAR_LENGTH;i++){
img=document.createElement("img");
img.setAttribute("src", BAR_IMG2);
diff --git a/source/de/anomic/crawler/Balancer.java b/source/de/anomic/crawler/Balancer.java
index fbab98ae9..33dfbb115 100644
--- a/source/de/anomic/crawler/Balancer.java
+++ b/source/de/anomic/crawler/Balancer.java
@@ -580,10 +580,12 @@ public class Balancer {
// behave in a DoS-manner
Log.logInfo("BALANCER", "forcing crawl-delay of " + sleeptime + " milliseconds for " + crawlEntry.url().getHost() + ((sleeptime > Math.max(minimumLocalDelta, minimumGlobalDelta)) ? " (caused by robots.txt)" : ""));
if (System.currentTimeMillis() - this.lastPrepare > 10000) {
- prepare(100);
+ long t = System.currentTimeMillis();
+ prepare(400);
this.lastPrepare = System.currentTimeMillis();
+ sleeptime -= this.lastPrepare - t;
}
- try {synchronized(this) { this.wait(sleeptime); }} catch (final InterruptedException e) {}
+ if (sleeptime > 0) try {synchronized(this) { this.wait(sleeptime); }} catch (final InterruptedException e) {}
}
// update statistical data