|
|
|
@ -108,7 +108,11 @@ public class yacyPeerActions {
|
|
|
|
|
}
|
|
|
|
|
long uptime = ((System.currentTimeMillis() - Long.parseLong(sb.getConfig("startupTime", "0"))) / 1000) / 60;
|
|
|
|
|
long uptimediff = uptime - Long.parseLong(sb.getConfig("lastseedcheckUptime", "0")); //TODO: Do not use the switchboard?
|
|
|
|
|
long indexedc = sb.getThread("80_indexing").getBusyCycles();
|
|
|
|
|
int indexing_cluster = Integer.parseInt(sb.getConfig("80_indexing_cluster", "1"));
|
|
|
|
|
if (indexing_cluster < 1) indexing_cluster = 1;
|
|
|
|
|
long indexedc = 0;
|
|
|
|
|
for(int i=0;i<indexing_cluster;++i)
|
|
|
|
|
indexedc += sb.getThread((80+i)+"_indexing").getBusyCycles();
|
|
|
|
|
long indexedcdiff = indexedc - Long.parseLong(sb.getConfig("lastseedcheckIndexedc", "0"));
|
|
|
|
|
if( uptimediff > 5 || ((String)sb.getConfig("lastseedcheckUptime", "-1")).equals("-1") ){
|
|
|
|
|
sb.setConfig("lastseedcheckUptime", uptime);
|
|
|
|
@ -123,9 +127,12 @@ public class yacyPeerActions {
|
|
|
|
|
seedDB.mySeed.put(yacySeed.ISPEED, Long.toString(0));
|
|
|
|
|
}else{
|
|
|
|
|
//set the PPM
|
|
|
|
|
seedDB.mySeed.put(yacySeed.ISPEED, Long.toString(indexedcdiff / uptimediff));
|
|
|
|
|
seedDB.mySeed.put(yacySeed.ISPEED, Long.toString(indexedcdiff / uptimediff));
|
|
|
|
|
}
|
|
|
|
|
sb.setConfig("totalPPM", Long.toString(indexedc / (uptime + 1)));
|
|
|
|
|
if(uptime > 0)
|
|
|
|
|
sb.setConfig("totalPPM", Long.toString(indexedc / uptime));
|
|
|
|
|
else
|
|
|
|
|
sb.setConfig("totalPPM", Long.toString(indexedc / 1)); //no division by zero
|
|
|
|
|
|
|
|
|
|
seedDB.mySeed.put(yacySeed.UPTIME, Long.toString(uptime)); // the number of minutes that the peer is up in minutes/day (moving average MA30)
|
|
|
|
|
seedDB.mySeed.put(yacySeed.LCOUNT, Integer.toString(sb.urlPool.loadedURL.size())); // the number of links that the peer has stored (LURL's)
|
|
|
|
|