From 649f3373ebd781ae2f7f4a592230a3a49a6d33df Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 15 Nov 1996 15:03:58 +0000 Subject: [PATCH] Logging of execution speed by using the times(2) call. --- index/zserver.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/index/zserver.c b/index/zserver.c index 9d91561..3e38dad 100644 --- a/index/zserver.c +++ b/index/zserver.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zserver.c,v $ - * Revision 1.42 1996-11-08 11:10:36 adam + * Revision 1.43 1996-11-15 15:03:58 adam + * Logging of execution speed by using the times(2) call. + * + * Revision 1.42 1996/11/08 11:10:36 adam * Buffers used during file match got bigger. * Compressed ISAM support everywhere. * Bug fixes regarding masking characters in queries. @@ -164,10 +167,23 @@ #include #include #include + +#ifdef __LINUX__ +#define USE_TIMES 1 +#endif + +#if USE_TIMES +#include +#endif #include "zserver.h" ZServerInfo server_info; +#if USE_TIMES +static struct tms tms1; +static struct tms tms2; +#endif + static int register_lock (ZServerInfo *zi) { time_t lastChange; @@ -182,6 +198,9 @@ static int register_lock (ZServerInfo *zi) state = 0; } zebraServerLock (state); +#if USE_TIMES + times (&tms1); +#endif if (zi->registerState == state) { if (zi->registerChange >= lastChange) @@ -233,6 +252,12 @@ static void register_unlock (ZServerInfo *zi) { static int waitSec = -1; +#if USE_TIMES + times (&tms2); + logf (LOG_LOG, "user/system: %ld/%ld", + (long) (tms2.tms_utime - tms1.tms_utime), + (long) (tms2.tms_stime - tms1.tms_stime)); +#endif if (waitSec == -1) { char *s = res_get (common_resource, "debugRequestWait"); -- 1.7.10.4