From 1deca02b41aae9bf2632ea1420cc900fcf41531d Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 12 Oct 2000 13:40:55 +0000 Subject: Added some stat stuff. 2000-10-12 Not Zed * index.h: Added some stat stuff. * wordindex.c (struct _wordcache): Changed files[] to be a pointer to an allocated block/or an individual item. (find): Fix for changes to struct. (find_name): " (sync_cache_entry): " (add): " (add_list): " (add_index_cache): Free the cache file array if it was created. (word_flush): And here. (word_close): And here too. (ibex_create_word_index): Double the size of the hashtables. (word_flush): Make sure we reset the wordcount to 0 if we remove the list items. DOH. (add_index_cache): Use a slightly more sohpisticated aging algorithm to remove expired nodes. 2000-10-10 Not Zed * hash.c (hash_find): (hash_remove): (hash_insert): Truncate key if it is too big to fit in a single block to MAX_KEYLEN bytes. svn path=/trunk/; revision=5882 --- libibex/index.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libibex/index.h') diff --git a/libibex/index.h b/libibex/index.h index 35e3df23c2..c3c83c1bcf 100644 --- a/libibex/index.h +++ b/libibex/index.h @@ -25,10 +25,16 @@ /* an indexing 'class' maps a key to 1 piece of info */ +#define INDEX_STAT + struct _IBEXIndex { struct _IBEXIndexClass *klass; struct _memcache *blocks; blockid_t root; /* root block of ondisk index data */ +#ifdef INDEX_STAT + int lookups; /* how many lookups */ + int lookup_total; /* how many blocks loaded for all lookups (hash chain depth) */ +#endif }; struct _IBEXIndexClass { -- cgit v1.2.3