From 12f3921ae6c4279e7c0bdf8e1eca400600bdfb1c Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 16 Jan 2008 11:54:28 +0000 Subject: [PATCH] Zebra logs timing for facet results --- index/retrieve.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/index/retrieve.c b/index/retrieve.c index ff3bced..a1b7011 100644 --- a/index/retrieve.c +++ b/index/retrieve.c @@ -1,4 +1,4 @@ -/* $Id: retrieve.c,v 1.82 2007-12-05 09:55:57 adam Exp $ +/* $Id: retrieve.c,v 1.83 2008-01-16 11:54:28 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -789,6 +789,7 @@ static ZEBRA_RES facet_fetch(ZebraHandle zh, const char *setname, } else { + yaz_timing_t timing = yaz_timing_create(); zebra_strmap_t *map_array = odr_malloc(odr, sizeof *map_array * no_ord); for (i = 0; i < no_ord; i++) @@ -847,6 +848,10 @@ static ZEBRA_RES facet_fetch(ZebraHandle zh, const char *setname, rec_free(&rec); } } + yaz_timing_stop(timing); + yaz_log(YLOG_LOG, "facet first phase real=%4.2f", + yaz_timing_get_real(timing)); + yaz_timing_start(timing); if (use_xml) wrbuf_puts(wr, "\n"); for (spec = spec_list, i = 0; i < no_ord; i++, spec = spec->next) @@ -904,9 +909,11 @@ static ZEBRA_RES facet_fetch(ZebraHandle zh, const char *setname, wrbuf_puts(wr, "\n"); for (i = 0; i < no_ord; i++) zebra_strmap_destroy(map_array[i]); + yaz_timing_stop(timing); + yaz_log(YLOG_LOG, "facet second phase real=%4.2f", + yaz_timing_get_real(timing)); + yaz_timing_destroy(&timing); } - - *rec_bufp = odr_strdup(odr, wrbuf_cstr(wr)); wrbuf_destroy(wr); *rec_lenp = strlen(*rec_bufp); -- 1.7.10.4