According to Reich, Stefan:
> anyone an idea how I can log the time htsearch needs to find and present the
> results into the htdig logfile?
> Of course I could wrap my htsearch in a script and log the time, but I would
> prefer to merge this information into the normal htdig logfile. So I can get
> a statistics of which word needs how long to be found.
> 
> Any utilites, patches, something else out there?

Here's an untested hack that should do the trick.  It'll report the time
in seconds from the start of execution up to just before outputing the
results, which is when the logging is done.

--- htsearch/Display.cc.orig    Thu Feb 17 10:43:28 2000
+++ htsearch/Display.cc Mon Apr 30 13:51:21 2001
@@ -1337,6 +1337,7 @@ Display::logSearch(int page, List *match
     int         facility = LOG_FACILITY;
     char        *host = getenv("REMOTE_HOST");
     char        *ref = getenv("HTTP_REFERER");
+    int                sec = (5 * 60) - alarm(120);
 
     if (host == NULL)
       host = getenv("REMOTE_ADDR");
@@ -1350,11 +1351,11 @@ Display::logSearch(int page, List *match
        nMatches = matches->Count();
 
     openlog("htsearch", LOG_PID, facility);
-    syslog(level, "%s [%s] (%s) [%s] [%s] (%d/%s) - %d -- %s\n",
+    syslog(level, "%s [%s] (%s) [%s] [%s] (%d/%s) - %d -- %s (%d s)\n",
           host,
           input->exists("config") ? input->get("config") : "default",
           config["match_method"], input->get("words"), logicalWords.get(),
           nMatches, config["matches_per_page"],
-          page, ref
+          page, ref, sec
           );
 }

-- 
Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a 
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html

Reply via email to