fixed bugs in seach statistics

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3240 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent 139810d504
commit 76fab83395

@ -1,4 +1,4 @@
// SearchStatisticsLocal_p.java
// SearchStatistics_p.java
// (C) 2006 by Michael Peter Christen; mc@anomic.de, Frankfurt a. M., Germany
// first published 14.01.2007 on http://www.anomic.de
//
@ -73,7 +73,7 @@ public class SearchStatistics_p {
if (page <= 2) {
prop.put("page_list_" + entCount + "_querywords", new String(a));
} else {
prop.put("page_list_" + entCount + "_queryhashes", plasmaSearchQuery.hashSet2hashString((Set) searchProfile.get("queryhashes")));
prop.put("page_list_" + entCount + "_queryhashes", plasmaSearchQuery.anonymizedQueryHashes((Set) searchProfile.get("queryhashes")));
}
prop.put("page_list_" + entCount + "_querycount", ((Integer) searchProfile.get("querycount")).toString());
prop.put("page_list_" + entCount + "_querytime", ((Long) searchProfile.get("querytime")).toString());

@ -49,7 +49,6 @@ import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeSet;

@ -126,13 +126,8 @@ public final class search {
// prepare search
final Set keyhashes = plasmaSearchQuery.hashes2Set(query);
final long timestamp = System.currentTimeMillis();
serverObjects prop = new serverObjects();
long timestamp1 = System.currentTimeMillis();
// prepare an abstract result
StringBuffer indexabstract = new StringBuffer();
int joincount = 0;
@ -248,6 +243,8 @@ public final class search {
// prepare search statistics
Long trackerHandle = new Long(System.currentTimeMillis());
HashMap searchProfile = theSearch.resultProfile();
searchProfile.put("resulttime", new Long(System.currentTimeMillis() - timestamp));
searchProfile.put("resultcount", new Integer(joincount));
String client = (String) header.get("CLIENTIP");
searchProfile.put("host", client);
sb.remoteSearches.put(trackerHandle, searchProfile);
@ -305,7 +302,7 @@ public final class search {
prop.putASIS("fwrec", ""); // peers that would have helped to construct this result (recommendations)
// log
yacyCore.log.logInfo("EXIT HASH SEARCH: " + plasmaSearchQuery.anonymizedQueryHashes(squery.queryHashes) + " - " + joincount + " links found, " + prop.get("linkcount", "?") + " links selected, " + ((System.currentTimeMillis() - timestamp1) / 1000) + " seconds");
yacyCore.log.logInfo("EXIT HASH SEARCH: " + plasmaSearchQuery.anonymizedQueryHashes(squery.queryHashes) + " - " + joincount + " links found, " + prop.get("linkcount", "?") + " links selected, " + ((System.currentTimeMillis() - timestamp) / 1000) + " seconds");
prop.putASIS("searchtime", Long.toString(System.currentTimeMillis() - timestamp));

@ -140,6 +140,7 @@ public final class plasmaSearchEvent extends Thread implements Runnable {
// so all search tasks are queued
synchronized (flushThreads) {
long start = System.currentTimeMillis();
plasmaSearchResult result;
if (query.domType == plasmaSearchQuery.SEARCHDOM_GLOBALDHT) {
int fetchpeers = (int) (query.maximumTime / 500L); // number of target peers; means 10 peers in 10 seconds
if (fetchpeers > 50) fetchpeers = 50;
@ -208,35 +209,32 @@ public final class plasmaSearchEvent extends Thread implements Runnable {
log.logFine("SEARCH TIME AFTER GLOBAL-TRIGGER TO " + fetchpeers + " PEERS: " + ((System.currentTimeMillis() - start) / 1000) + " seconds");
// combine the result and order
plasmaSearchResult result = orderFinal(rcLocal);
result = orderFinal(rcLocal);
if (result != null) {
result.globalContributions = globalContributions;
// flush results in a separate thread
this.start(); // start to flush results
}
// return search result
log.logFine("SEARCHRESULT: " + profileLocal.reportToString());
lastEvent = this;
this.searchtime = System.currentTimeMillis() - start;
this.searchcount = result.filteredResults;
return result;
} else {
Map searchContainerMap = localSearchContainers(null);
indexContainer rcLocal = (searchContainerMap == null) ? wordIndex.emptyContainer(null) : localSearchJoin(searchContainerMap.values());
plasmaSearchResult result = orderFinal(rcLocal);
result = orderFinal(rcLocal);
result.globalContributions = 0;
}
// return search result
// log the event
log.logFine("SEARCHRESULT: " + profileLocal.reportToString());
// prepare values for statistics
lastEvent = this;
this.searchtime = System.currentTimeMillis() - start;
this.searchcount = result.filteredResults;
// return search result
return result;
}
}
}
private void prepareSecondarySearch() {
// catch up index abstracts and join them; then call peers again to submit their urls

Loading…
Cancel
Save