display wordcaches number on WatchCrawler.html

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1746 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 19 years ago
parent bd77ff130a
commit 7e7a72b108

@ -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>

@ -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);
}
}

@ -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;

@ -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>

Loading…
Cancel
Save