summaryrefslogtreecommitdiff
path: root/src/btree/bt_stat.c
diff options
context:
space:
mode:
authorDon Anderson <dda@ddanderson.com>2015-03-11 22:48:12 -0400
committerDon Anderson <dda@ddanderson.com>2015-03-11 22:48:12 -0400
commita1c9f8f8833482c9773fc30b7b9a7b5f1ab09014 (patch)
tree110af17879044bccd9843a24c5eb33aa7137a5b3 /src/btree/bt_stat.c
parentdf05a6ec71ff1f4fedd8045d7c735f8ef828fdf8 (diff)
downloadmongo-a1c9f8f8833482c9773fc30b7b9a7b5f1ab09014.tar.gz
Made some adjustments to stats so that the btree entries is an accurate
total for row and column stores. Entries that appear in internal pages (pointing to leaf pages or other internal pages) are no longer counted. Added and modified tests to check the number of btree entries reported by stats against the number of KV pairs expected to be in btree. Refs #1733.
Diffstat (limited to 'src/btree/bt_stat.c')
-rw-r--r--src/btree/bt_stat.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/btree/bt_stat.c b/src/btree/bt_stat.c
index b550158a5a9..638ebfb109d 100644
--- a/src/btree/bt_stat.c
+++ b/src/btree/bt_stat.c
@@ -87,7 +87,6 @@ __stat_page(WT_SESSION_IMPL *session, WT_PAGE *page, WT_DSRC_STATS *stats)
case WT_PAGE_COL_INT:
WT_STAT_INCR(stats, btree_column_internal);
pindex = WT_INTL_INDEX_COPY(page);
- WT_STAT_INCRV(stats, btree_entries, pindex->entries);
break;
case WT_PAGE_COL_VAR:
__stat_page_col_var(page, stats);
@@ -139,7 +138,8 @@ __stat_page_col_var(WT_PAGE *page, WT_DSRC_STATS *stats)
} else {
orig_deleted = 0;
__wt_cell_unpack(cell, unpack);
- entry_cnt += __wt_cell_rle(unpack);
+ if (unpack->type != WT_CELL_ADDR_DEL)
+ entry_cnt += __wt_cell_rle(unpack);
if (unpack->ovfl)
++ovfl_cnt;
}
@@ -165,7 +165,10 @@ __stat_page_col_var(WT_PAGE *page, WT_DSRC_STATS *stats)
/* Walk any append list. */
WT_SKIP_FOREACH(ins, WT_COL_APPEND(page))
- ++entry_cnt;
+ if (WT_UPDATE_DELETED_ISSET(ins->upd))
+ ++deleted_cnt;
+ else
+ ++entry_cnt;
WT_STAT_INCRV(stats, btree_column_deleted, deleted_cnt);
WT_STAT_INCRV(stats, btree_entries, entry_cnt);
@@ -196,7 +199,6 @@ __stat_page_row_int(
* internal page.
*/
pindex = WT_INTL_INDEX_COPY(page);
- WT_STAT_INCRV(stats, btree_entries, pindex->entries);
/*
* Overflow keys are hard: we have to walk the disk image to count them,