X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzebraapi.c;h=58b99beb0ba1b2b490a65729840e8039d9c97134;hb=3e72747f4b28856e5f684dbe8984f8fb28680e62;hp=0cf60f36d6aa472e9e93b1d9a316647414324b19;hpb=764b78fb481cf1084a5a583ffefbe8a0f32af28c;p=idzebra-moved-to-github.git diff --git a/index/zebraapi.c b/index/zebraapi.c index 0cf60f3..58b99be 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2002, Index Data * All rights reserved. * - * $Id: zebraapi.c,v 1.57 2002-04-16 22:31:42 adam Exp $ + * $Id: zebraapi.c,v 1.59 2002-04-26 08:44:47 adam Exp $ */ #include @@ -50,9 +50,6 @@ static struct zebra_register *zebra_register_open (ZebraService zs, const char *reg_path); static void zebra_register_close (ZebraService zs, struct zebra_register *reg); -static int zebra_begin_read (ZebraHandle zh); -static void zebra_end_read (ZebraHandle zh); - ZebraHandle zebra_open (ZebraService zs) { ZebraHandle zh; @@ -922,7 +919,7 @@ void zebra_get_state (ZebraHandle zh, char *val, int *seqno) xfree (fname); } -static int zebra_begin_read (ZebraHandle zh) +int zebra_begin_read (ZebraHandle zh) { int dirty = 0; char val; @@ -937,6 +934,9 @@ static int zebra_begin_read (ZebraHandle zh) zebra_flush_reg (zh); return 0; } +#if HAVE_SYS_TIMES_H + times (&zh->tms1); +#endif if (!zh->res) { (zh->trans_no)--; @@ -985,13 +985,21 @@ static int zebra_begin_read (ZebraHandle zh) return 0; } -static void zebra_end_read (ZebraHandle zh) +void zebra_end_read (ZebraHandle zh) { (zh->trans_no)--; if (zh->trans_no != 0) return; +#if HAVE_SYS_TIMES_H + times (&zh->tms2); + logf (LOG_LOG, "user/system: %ld/%ld", + (long) (zh->tms2.tms_utime - zh->tms1.tms_utime), + (long) (zh->tms2.tms_stime - zh->tms1.tms_stime)); + +#endif + zebra_unlock (zh->lock_normal); zebra_unlock (zh->lock_shadow); }