*) used more switchboard-vars instead of config-vars

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3310 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
auron_x 18 years ago
parent 4f6eed5623
commit 89e7af037a

@ -241,8 +241,12 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
private plasmaDHTChunk dhtTransferChunk = null;
public TreeMap localSearches, remoteSearches;
public HashMap localSearchTracker, remoteSearchTracker;
public long startupTime = 0;
public long lastseedcheckuptime = -1;
public long indexedPages = 0;
public long lastindexedPages = 0;
public double requestedQueries = 0d;
public double lastrequestedQueries = 0d;
/*
* Remote Proxy configuration

@ -109,21 +109,21 @@ public class yacyPeerActions {
seedDB.mySeed.put(yacySeed.PORT, Integer.toString(serverCore.getPortNr(sb.getConfig("port", "8080"))));
}
long uptime = ((System.currentTimeMillis() - sb.getConfigLong("startupTime", 0)) / 1000);
long uptimediff = uptime - sb.getConfigLong("lastseedcheckUptime", 0); //TODO: Do not use the switchboard?
long indexedcdiff = sb.indexedPages - sb.getConfigLong("lastseedcheckIndexedc", 0);
double requestcdiff = sb.requestedQueries - sb.getConfigDouble("lastseedcheckRequestc", 0d);
if (uptimediff > 300 || sb.getConfigLong("lastseedcheckUptime", -1) == -1 ) {
sb.setConfig("lastseedcheckUptime", uptime);
sb.setConfig("lastseedcheckIndexedc", sb.indexedPages);
sb.setConfig("lastseedcheckRequestc", sb.requestedQueries);
long uptime = (System.currentTimeMillis() - sb.startupTime) / 1000;
long uptimediff = uptime - sb.lastseedcheckuptime;
long indexedcdiff = sb.indexedPages - sb.lastindexedPages;
double requestcdiff = sb.requestedQueries - sb.lastrequestedQueries;
if (uptimediff > 300 || sb.lastseedcheckuptime == -1 ) {
sb.lastseedcheckuptime = uptime;
sb.lastindexedPages = sb.indexedPages;
sb.lastrequestedQueries = sb.requestedQueries;
}
//the speed of indexing (pages/minute) of the peer
seedDB.mySeed.put(yacySeed.ISPEED, Long.toString(Math.round(Math.max((float) indexedcdiff, 0f) * 60f / Math.max((float) uptimediff, 1f))));
sb.setConfig("totalPPM", Long.toString(sb.indexedPages * 60 / Math.max(uptime, 1)));
sb.setConfig("totalPPM", sb.indexedPages * 60 / Math.max(uptime, 1));
seedDB.mySeed.put(yacySeed.RSPEED, Long.toString(Math.round(Math.max((float) requestcdiff, 0f) * 60f / Math.max((float) uptimediff, 1f))));
sb.setConfig("totalQPM", Double.toString(sb.requestedQueries * 60d / Math.max((double) uptime, 1d)));
sb.setConfig("totalQPM", sb.requestedQueries * 60d / Math.max((double) uptime, 1d));
seedDB.mySeed.put(yacySeed.UPTIME, Long.toString(uptime/60)); // the number of minutes that the peer is up in minutes/day (moving average MA30)
seedDB.mySeed.put(yacySeed.LCOUNT, Integer.toString(sb.wordIndex.loadedURL.size())); // the number of links that the peer has stored (LURL's)

@ -308,7 +308,7 @@ public final class yacy {
sb.setConfig("vString", combined2prettyVersion(Double.toString(version)));
sb.setConfig("vdate", vDATE);
sb.setConfig("applicationRoot", homePath);
sb.setConfig("startupTime", Long.toString(startup));
sb.startupTime = startup;
serverLog.logConfig("STARTUP", "YACY Version: " + version + ", Built " + vDATE);
yacyCore.latestVersion = version;

Loading…
Cancel
Save