X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=isamb%2Ftstisamb.c;h=d48d837564b45251248a9737d44df8dae9fce054;hp=4103211742341c54d93e550893b22907e5128ba7;hb=aeea139423b8eaf28a4de53b3d7b2ad1f22284e7;hpb=4eaf00a0af4c40bd166e2224964319a58efafeaa diff --git a/isamb/tstisamb.c b/isamb/tstisamb.c index 4103211..d48d837 100644 --- a/isamb/tstisamb.c +++ b/isamb/tstisamb.c @@ -1,8 +1,5 @@ -/* $Id: tstisamb.c,v 1.26 2006-12-07 21:13:56 adam Exp $ - Copyright (C) 1995-2006 - Index Data ApS - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + Copyright (C) 1994-2011 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -20,6 +17,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #if HAVE_SYS_TIMES_H #include #endif @@ -34,16 +34,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include +static int log_level = 0; + static void log_item(int level, const void *b, const char *txt) { int x; memcpy(&x, b, sizeof(int)); - yaz_log(YLOG_DEBUG, "%s %d", txt, x); + yaz_log(log_level, "%s %d", txt, x); } static void log_pr(const char *txt) { - yaz_log(YLOG_DEBUG, "%s", txt); + yaz_log(log_level, "%s", txt); } int compare_item(const void *a, const void *b) @@ -104,70 +106,11 @@ int code_read(void *vp, char **dst, int *insertMode) *insertMode = ri->insertMode; #if 0 - yaz_log(YLOG_LOG, "%d %5d", ri->insertMode, x); + yaz_log(log_level, "%d %5d", ri->insertMode, x); #endif return 1; } -void bench_insert(ISAMB isb, int number_of_trees, - int number_of_rounds, int number_of_elements) -{ - ISAMC_I isamc_i; - ISAM_P *isamc_p = xmalloc(sizeof(ISAM_P) * number_of_trees); - struct read_info ri; - int round, i; - - for (i = 0; iidx >= ri->max) return 0; - + if (ri->delta[ri->idx] > 0) { ri->level++; @@ -414,7 +357,7 @@ void tst_random(ISAMB isb, int n, int rounds, int max_dups) int i, j; for (i = 0; i