projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
zebraidx prints user/sys times
[idzebra-moved-to-github.git]
/
index
/
zebraapi.c
diff --git
a/index/zebraapi.c
b/index/zebraapi.c
index
7d1eac2
..
e13c05e
100644
(file)
--- a/
index/zebraapi.c
+++ b/
index/zebraapi.c
@@
-2,7
+2,7
@@
* Copyright (C) 1995-2002, Index Data
* All rights reserved.
*
* Copyright (C) 1995-2002, Index Data
* All rights reserved.
*
- * $Id: zebraapi.c,v 1.55 2002-04-15 13:48:11 adam Exp $
+ * $Id: zebraapi.c,v 1.58 2002-04-23 18:07:17 adam Exp $
*/
#include <assert.h>
*/
#include <assert.h>
@@
-187,6
+187,7
@@
struct zebra_register *zebra_register_open (ZebraService zs, const char *name,
reg->isam = 0;
reg->isamc = 0;
reg->isamd = 0;
reg->isam = 0;
reg->isamc = 0;
reg->isamd = 0;
+ reg->isamb = 0;
reg->zei = 0;
reg->matchDict = 0;
reg->zei = 0;
reg->matchDict = 0;
@@
-227,7
+228,7
@@
struct zebra_register *zebra_register_open (ZebraService zs, const char *name,
return 0;
}
}
return 0;
}
}
- else if (res_get_match (res, "isam", "i", ISAM_DEFAULT))
+ if (res_get_match (res, "isam", "i", ISAM_DEFAULT))
{
if (!(reg->isam = is_open (reg->bfs, FNAME_ISAM, key_compare, rw,
sizeof (struct it_key), res)))
{
if (!(reg->isam = is_open (reg->bfs, FNAME_ISAM, key_compare, rw,
sizeof (struct it_key), res)))
@@
-236,7
+237,7
@@
struct zebra_register *zebra_register_open (ZebraService zs, const char *name,
return 0;
}
}
return 0;
}
}
- else if (res_get_match (res, "isam", "c", ISAM_DEFAULT))
+ if (res_get_match (res, "isam", "c", ISAM_DEFAULT))
{
struct ISAMC_M_s isamc_m;
if (!(reg->isamc = isc_open (reg->bfs, FNAME_ISAMC,
{
struct ISAMC_M_s isamc_m;
if (!(reg->isamc = isc_open (reg->bfs, FNAME_ISAMC,
@@
-246,7
+247,7
@@
struct zebra_register *zebra_register_open (ZebraService zs, const char *name,
return 0;
}
}
return 0;
}
}
- else if (res_get_match (res, "isam", "d", ISAM_DEFAULT))
+ if (res_get_match (res, "isam", "d", ISAM_DEFAULT))
{
struct ISAMD_M_s isamd_m;
{
struct ISAMD_M_s isamd_m;
@@
-257,6
+258,17
@@
struct zebra_register *zebra_register_open (ZebraService zs, const char *name,
return 0;
}
}
return 0;
}
}
+ if (res_get_match (res, "isam", "b", ISAM_DEFAULT))
+ {
+ struct ISAMC_M_s isamc_m;
+
+ if (!(reg->isamb = isamb_open (reg->bfs, "isamb",
+ rw, key_isamc_m(res, &isamc_m))))
+ {
+ logf (LOG_WARN, "isamb_open");
+ return 0;
+ }
+ }
reg->zei = zebraExplain_open (reg->records, reg->dh,
res, rw, reg,
explain_extract);
reg->zei = zebraExplain_open (reg->records, reg->dh,
res, rw, reg,
explain_extract);
@@
-305,6
+317,8
@@
static void zebra_register_close (ZebraService zs, struct zebra_register *reg)
isc_close (reg->isamc);
if (reg->isamd)
isamd_close (reg->isamd);
isc_close (reg->isamc);
if (reg->isamd)
isamd_close (reg->isamd);
+ if (reg->isamb)
+ isamb_close (reg->isamb);
rec_close (®->records);
}
rec_close (®->records);
}
@@
-384,7
+398,7
@@
void zebra_close (ZebraHandle zh)
zebra_mutex_cond_unlock (&zs->session_lock);
xfree (zh->reg_name);
xfree (zh);
zebra_mutex_cond_unlock (&zs->session_lock);
xfree (zh->reg_name);
xfree (zh);
- yaz_log (LOG_LOG, "zebra_close zh=%p end", zh);}
+}
struct map_baseinfo {
ZebraHandle zh;
struct map_baseinfo {
ZebraHandle zh;
@@
-923,6
+937,9
@@
static int zebra_begin_read (ZebraHandle zh)
zebra_flush_reg (zh);
return 0;
}
zebra_flush_reg (zh);
return 0;
}
+#if HAVE_SYS_TIMES_H
+ times (&zh->tms1);
+#endif
if (!zh->res)
{
(zh->trans_no)--;
if (!zh->res)
{
(zh->trans_no)--;
@@
-978,6
+995,14
@@
static void zebra_end_read (ZebraHandle zh)
if (zh->trans_no != 0)
return;
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);
}
zebra_unlock (zh->lock_normal);
zebra_unlock (zh->lock_shadow);
}
@@
-998,6
+1023,12
@@
void zebra_begin_trans (ZebraHandle zh)
}
yaz_log (LOG_LOG, "zebra_begin_trans");
}
yaz_log (LOG_LOG, "zebra_begin_trans");
+
+ zh->records_inserted = 0;
+ zh->records_updated = 0;
+ zh->records_deleted = 0;
+ zh->records_processed = 0;
+
#if HAVE_SYS_TIMES_H
times (&zh->tms1);
#endif
#if HAVE_SYS_TIMES_H
times (&zh->tms1);
#endif
@@
-1078,6
+1109,11
@@
void zebra_end_trans (ZebraHandle zh)
zebra_register_close (zh->service, zh->reg);
zh->reg = 0;
zebra_register_close (zh->service, zh->reg);
zh->reg = 0;
+
+ yaz_log (LOG_LOG, "Records: %7d i/u/d %d/%d/%d",
+ zh->records_processed, zh->records_inserted,
+ zh->records_updated, zh->records_deleted);
+
zebra_get_state (zh, &val, &seqno);
if (val != 'd')
{
zebra_get_state (zh, &val, &seqno);
if (val != 'd')
{