Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
*) used more switchboard-vars instead of config-vars
auron_x89e7af037a73
diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.javaindex f1da8c08a..073812502 100644--- a/source/de/anomic/plasma/plasmaSwitchboard.java+++ b/source/de/anomic/plasma/plasmaSwitchboard.java@@ -241,8 +241,12 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements serprivate 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 configurationdiff --git a/source/de/anomic/yacy/yacyPeerActions.java b/source/de/anomic/yacy/yacyPeerActions.javaindex 71df6437e..81730d0f6 100644--- a/source/de/anomic/yacy/yacyPeerActions.java+++ b/source/de/anomic/yacy/yacyPeerActions.java@@ -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 peerseedDB.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)diff --git a/source/yacy.java b/source/yacy.javaindex e37dba90b..0f7aadd14 100644--- a/source/yacy.java+++ b/source/yacy.java@@ -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;