Skip to content

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

display wordcaches number on WatchCrawler.html

allo7e7a72b108a7
diff --git a/htroot/WatchCrawler.html b/htroot/WatchCrawler.html
index 42fee3b28..2a4bec7f8 100644
--- a/htroot/WatchCrawler.html
+++ b/htroot/WatchCrawler.html
@@ -13,7 +13,8 @@
<p />
<div>
Next update in <span id="nextUpdate" onclick="changeInterval()"></span> seconds.<br />
-PPM: <span id="ppm">&nbsp;&nbsp;&nbsp;</span>
+PPM: <span id="ppm">&nbsp;&nbsp;&nbsp;</span><br />
+wordcaches: <span id="wordcache">&nbsp;</span>
</div>
<p />
<div>
diff --git a/htroot/js/WatchCrawler.js b/htroot/js/WatchCrawler.js
index 3d843b2d8..7db88f054 100644
--- a/htroot/js/WatchCrawler.js
+++ b/htroot/js/WatchCrawler.js
@@ -1,4 +1,8 @@
-DELETE_STRING="delete"
+DELETE_STRING="delete";
+BAR_IMG1="/env/grafics/green-bar.png";
+BAR_IMG2="/env/grafics/red-bar.png";
+WORDCACHEBAR_LENGTH=1/4;
+
var statusRPC;
var queuesRPC;
@@ -60,6 +64,7 @@ function handleStatus(){
}
var statusResponse = statusRPC.responseXML;
statusTag=getFirstChild(getFirstChild(statusResponse, ""), "status")
+
ppm=getValue(getFirstChild(statusTag, "ppm"))
var ppmSpan = document.getElementById("ppm");
removeAllChildren(ppmSpan);
@@ -67,9 +72,37 @@ function handleStatus(){
ppmSpan.appendChild(document.createElement("br"));
for(i=0;i<ppm;i++){
img=document.createElement("img");
- img.setAttribute("src", "/env/grafics/green-bar.png");
+ img.setAttribute("src", BAR_IMG1);
ppmSpan.appendChild(img);
}
+
+ var wordCache=getValue(getFirstChild(statusTag, "wordCacheSize"));
+ var wordCacheMaxLow=getValue(getFirstChild(statusTag, "wordCacheMaxLow"));
+ var wordCacheMaxHigh=getValue(getFirstChild(statusTag, "wordCacheMaxHigh"));
+ //use Low as default, but High if there are more wordcaches
+ var wordCacheMax=wordCacheMaxLow;
+ if(wordCache>wordCacheMax){
+ wordCacheMax=wordCacheMaxHigh;
+ }
+ var percent=Math.round(wordCache/wordCacheMax*100);
+
+
+ wordCacheSpan=document.getElementById("wordcache");
+
+ removeAllChildren(wordCacheSpan);
+ wordCacheSpan.appendChild(document.createTextNode(wordCache+"/"+wordCacheMax));
+ wordCacheSpan.appendChild(document.createElement("br"));
+ var img;
+ for(i=0;i<percent*WORDCACHEBAR_LENGTH;i++){
+ img=document.createElement("img");
+ img.setAttribute("src", BAR_IMG2);
+ wordCacheSpan.appendChild(img);
+ }
+ for(i=0;i<(100-percent)*WORDCACHEBAR_LENGTH;i++){
+ img=document.createElement("img");
+ img.setAttribute("src", BAR_IMG1);
+ wordCacheSpan.appendChild(img);
+ }
}
diff --git a/htroot/xml/status_p.java b/htroot/xml/status_p.java
index b362284ae..af9bc3d9e 100644
--- a/htroot/xml/status_p.java
+++ b/htroot/xml/status_p.java
@@ -64,8 +64,9 @@ public class status_p {
prop.put("rejected", 0);
yacyCore.peerActions.updateMySeed();
prop.put("ppm", yacyCore.seedDB.mySeed.get(yacySeed.ISPEED, "unknown"));
- prop.put("indexingQueueSize", Integer.toString(switchboard.getThread("80_indexing").getJobCount()+switchboard.indexingTasksInProcess.size()));
- prop.put("indexingQueueMax", Integer.toString(plasmaSwitchboard.indexingSlots));
+ prop.put("wordCacheSize", switchboard.wordIndex.wordCacheRAMSize());
+ prop.put("wordCacheMaxLow", switchboard.getConfig("wordCacheMaxLow", "10000"));
+ prop.put("wordCacheMaxHigh", switchboard.getConfig("wordCacheMaxHigh", "10000"));
// return rewrite properties
return prop;
diff --git a/htroot/xml/status_p.xml b/htroot/xml/status_p.xml
index c589ea1fa..0fb20f882 100644
--- a/htroot/xml/status_p.xml
+++ b/htroot/xml/status_p.xml
@@ -1,9 +1,8 @@
<xml version="1.0">
<status>
<ppm>#[ppm]#</ppm>
- <indexingqueue>
- <size>#[indexingQueueSize]#</size>
- <max>#[indexingQueueMax]#</max>
- </indexingqueue>
+ <wordCacheSize>#[wordCacheSize]#</wordCacheSize>
+ <wordCacheMaxLow>#[wordCacheMaxLow]#</wordCacheMaxLow>
+ <wordCacheMaxHigh>#[wordCacheMaxHigh]#</wordCacheMaxHigh>
</status>
</xml>