X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Frecstat.c;fp=index%2Frecstat.c;h=aa1ff6507ee37fe784d77d44953afd87a7bfc811;hb=226fb73f42a86cc30ff4f27eb452ab3f6c19ae01;hp=0000000000000000000000000000000000000000;hpb=7ef06055d9fe8e829dfa6401852ae5d843d21c80;p=idzebra-moved-to-github.git diff --git a/index/recstat.c b/index/recstat.c new file mode 100644 index 0000000..aa1ff65 --- /dev/null +++ b/index/recstat.c @@ -0,0 +1,51 @@ +/* + * Copyright (C) 1994-1995, Index Data I/S + * All rights reserved. + * Sebastian Hammer, Adam Dickmeiss + * + * $Log: recstat.c,v $ + * Revision 1.1 1995-12-06 12:41:26 adam + * New command 'stat' for the index program. + * Filenames can be read from stdin by specifying '-'. + * Bug fix/enhancement of the transformation from terms to regular + * expressons in the search engine. + * + */ +#include +#include +#include +#include +#include +#include +#include + +#include "recindxp.h" + +void rec_prstat (void) +{ + Records records = rec_open (0); + int i; + int total_bytes = 0; + + logf (LOG_LOG, + "Total records %8d", + records->head.no_records); + + for (i = 0; i< REC_BLOCK_TYPES; i++) + { + logf (LOG_LOG, "Record blocks of size %d", + records->head.block_size[i]); + logf (LOG_LOG, + " Used/Total/Bytes used %d/%d/%d", + records->head.block_used[i], records->head.block_last[i]-1, + records->head.block_used[i] * records->head.block_size[i]); + total_bytes += + records->head.block_used[i] * records->head.block_size[i]; + } + logf (LOG_LOG, + "Total size of record index in bytes %8d", + records->head.total_bytes); + logf (LOG_LOG, + "Total size with overhead %8d", total_bytes); + rec_close (&records); +}