Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added new qph column to search tracker servlet
orbiter9a8a87612dc6
diff --git a/htroot/SearchStatistics_p.html b/htroot/SearchStatistics_p.htmlindex baa1ba35e..55ca67989 100644--- a/htroot/SearchStatistics_p.html+++ b/htroot/SearchStatistics_p.html@@ -57,12 +57,14 @@<tr class="TableHeader"><td>Requesting Host</td><td>Count</td>+ <td>Queries Per Last Hour</td><td>Access Dates</td></tr>#{list}#<tr class="TableCell#(dark)#Light::Dark#(/dark)#"><td>#[host]#</td><td>#[count]#</td>+ <td>#[qph]#</td><td>#{dates}##[date]# #{/dates}#</td></tr>#{/list}#@@ -104,6 +106,7 @@<td>Requesting Host</td><td>Peer Name</td><td>Count</td>+ <td>Queries Per Last Hour</td><td>Access Dates</td></tr>#{list}#@@ -111,6 +114,7 @@<td>#[host]#</td><td>#[peername]#</td><td>#[count]#</td>+ <td>#[qph]#</td><td>#{dates}##[date]# #{/dates}#</td></tr>#{/list}#diff --git a/htroot/SearchStatistics_p.java b/htroot/SearchStatistics_p.javaindex 1a0ba9114..5129e1e04 100644--- a/htroot/SearchStatistics_p.java+++ b/htroot/SearchStatistics_p.java@@ -106,6 +106,8 @@ public class SearchStatistics_p {dateCount++;}prop.put("page_list_" + entCount + "_dates", dateCount);+ int qph = handles.tailSet(new Long(System.currentTimeMillis() - 1000 * 60 * 60)).size();+ prop.put("page_list_" + entCount + "_qph", qph);prop.put("page_list_" + entCount + "_dark", ((dark) ? 1 : 0) ); dark =! dark;prop.put("page_list_" + entCount + "_host", host);diff --git a/htroot/SearchStatistics_p.xml b/htroot/SearchStatistics_p.xmlindex e4ced47c1..7ed6f8d5a 100644--- a/htroot/SearchStatistics_p.xml+++ b/htroot/SearchStatistics_p.xml@@ -17,6 +17,7 @@<localSearchTracker>#{list}#<host>#[host]#</host><count>#[count]#</count>+ <qph>#[qph]#</qph><dates>#{dates}#<date timestamp="#[timestamp]#">#[date]#</date>#{/dates}#</dates>@@ -27,7 +28,7 @@<host>#[host]#</host><peername>#[peername]#</peername><date timestamp="#[timestamp]#">#[date]#</date>- <querycount>#[querycount]#</>+ <querycount>#[querycount]#</querycount><resultcount>#[resultcount]#</resultcount><querytime>#[querytime]#</querytime><resulttime>#[resulttime]#</resulttime>@@ -36,6 +37,12 @@::<!-- 4: Search Statistics: Remote Search Tracker --><remoteSearchTracker>#{list}#+ <host>#[host]#</host>+ <count>#[count]#</count>+ <qph>#[qph]#</qph>+ <dates>#{dates}#+ <date timestamp="#[timestamp]#">#[date]#</date>+ #{/dates}#</dates>#{/list}#</remoteSearchTracker>#(/page)#diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.javaindex 7ab51afe7..148db31c1 100644--- a/source/de/anomic/plasma/plasmaSwitchboard.java+++ b/source/de/anomic/plasma/plasmaSwitchboard.java@@ -241,7 +241,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements serpublic plasmaDHTFlush transferIdxThread = null;private plasmaDHTChunk dhtTransferChunk = null;public ArrayList localSearches, remoteSearches; // array of search result properties as HashMaps- public HashMap localSearchTracker, remoteSearchTracker;+ public HashMap localSearchTracker, remoteSearchTracker; // mappings from requesting host to a TreeSet of Long(access time)public long startupTime = 0;public long lastseedcheckuptime = -1;public long indexedPages = 0;@@ -3028,6 +3028,14 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser}+ public static int accessFrequency(HashMap tracker, String host) {+ // returns the access frequency in queries per hour for a given host and a specific tracker+ long timeInterval = 1000 * 60 * 60;+ TreeSet accessSet = (TreeSet) tracker.get(host);+ if (accessSet == null) return 0;+ return accessSet.tailSet(new Long(System.currentTimeMillis() - timeInterval)).size();+ }+public void startTransferWholeIndex(yacySeed seed, boolean delete) {if (transferIdxThread == null) {this.transferIdxThread = new plasmaDHTFlush(this.log, this.wordIndex, seed, delete,