fixed search access tracker

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4072 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 4779f314fe
commit e90afa9483

@ -231,21 +231,6 @@ public final class search {
}
prop.putASIS("indexabstract", new String(indexabstract));
// prepare search statistics
Long trackerHandle = new Long(System.currentTimeMillis());
String client = (String) header.get("CLIENTIP");
HashMap searchProfile = theQuery.resultProfile(System.currentTimeMillis() - timestamp);
searchProfile.put("host", client);
yacySeed remotepeer = yacyCore.seedDB.lookupByIP(natLib.getInetAddress(client), true, false, false);
searchProfile.put("peername", (remotepeer == null) ? "unknown" : remotepeer.getName());
searchProfile.put("time", trackerHandle);
sb.remoteSearches.add(searchProfile);
TreeSet handles = (TreeSet) sb.remoteSearchTracker.get(client);
if (handles == null) handles = new TreeSet();
handles.add(trackerHandle);
sb.remoteSearchTracker.put(client, handles);
// prepare result
if ((joincount == 0) || (accu == null)) {
@ -274,6 +259,20 @@ public final class search {
prop.putASIS("fwhop", ""); // hops (depth) of forwards that had been performed to construct this result
prop.putASIS("fwsrc", ""); // peers that helped to construct this result
prop.putASIS("fwrec", ""); // peers that would have helped to construct this result (recommendations)
// prepare search statistics
Long trackerHandle = new Long(System.currentTimeMillis());
HashMap searchProfile = theQuery.resultProfile(joincount, System.currentTimeMillis() - timestamp);
String client = (String) header.get("CLIENTIP");
searchProfile.put("host", client);
yacySeed remotepeer = yacyCore.seedDB.lookupByIP(natLib.getInetAddress(client), true, false, false);
searchProfile.put("peername", (remotepeer == null) ? "unknown" : remotepeer.getName());
searchProfile.put("time", trackerHandle);
sb.remoteSearches.add(searchProfile);
TreeSet handles = (TreeSet) sb.remoteSearchTracker.get(client);
if (handles == null) handles = new TreeSet();
handles.add(trackerHandle);
sb.remoteSearchTracker.put(client, handles);
// log
yacyCore.log.logInfo("EXIT HASH SEARCH: " +

@ -313,7 +313,7 @@ public class yacysearch {
// prepare search statistics
Long trackerHandle = new Long(System.currentTimeMillis());
HashMap searchProfile = theQuery.resultProfile(System.currentTimeMillis() - timestamp);
HashMap searchProfile = theQuery.resultProfile(theSearch.getLocalCount() + theSearch.getGlobalCount(), System.currentTimeMillis() - timestamp);
searchProfile.put("querystring", theQuery.queryString);
searchProfile.put("time", trackerHandle);
searchProfile.put("host", client);

@ -239,14 +239,14 @@ public final class plasmaSearchQuery {
return hashSet2hashString(this.queryHashes) + "-" + hashSet2hashString(this.excludeHashes) + ":" + this.contentdom;
}
public HashMap resultProfile(long searchtime) {
public HashMap resultProfile(int searchcount, long searchtime) {
// generate statistics about search: query, time, etc
HashMap r = new HashMap();
r.put("queryhashes", queryHashes);
r.put("querystring", queryString);
r.put("querycount", new Integer(linesPerPage));
r.put("querytime", new Long(maximumTime));
//r.put("resultcount", new Integer(searchcount));
r.put("resultcount", new Integer(searchcount));
r.put("resulttime", new Long(searchtime));
return r;
}

Loading…
Cancel
Save