summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2013-11-19 09:30:46 -0500
committerKeith Bostic <keith@wiredtiger.com>2013-11-19 09:30:46 -0500
commit27049022640f17f31bd4ded4a5719603b558608d (patch)
treebc684834a4a62270a6e2c0f14aae4bbe0339d3a4
parent97795b99ff0b1213f482fcb9003f6bb5fb4a974d (diff)
downloadmongo-27049022640f17f31bd4ded4a5719603b558608d.tar.gz
Give statistics' integer IDs separate namespaces.
Close #766.
-rw-r--r--dist/stat.py13
-rw-r--r--src/cursor/cur_stat.c51
-rw-r--r--src/include/cursor.h1
-rw-r--r--src/include/extern.h1
-rw-r--r--src/include/stat.h168
-rw-r--r--src/include/wiredtiger.in326
-rw-r--r--src/lsm/lsm_stat.c4
-rw-r--r--src/schema/schema_stat.c8
8 files changed, 301 insertions, 271 deletions
diff --git a/dist/stat.py b/dist/stat.py
index e6021cab18d..783f2f191f2 100644
--- a/dist/stat.py
+++ b/dist/stat.py
@@ -8,11 +8,13 @@ from dist import source_paths_list
# Read the source files.
from stat_data import dsrc_stats, connection_stats
-def print_struct(title, name, stats):
+def print_struct(title, name, base, stats):
'''Print the structures for the stat.h file.'''
f.write('/*\n')
f.write(' * Statistics entries for ' + title + '.\n')
f.write(' */\n')
+ f.write(
+ '#define\tWT_' + name.upper() + '_STATS_BASE\t' + str(base) + '\n')
f.write('struct __wt_' + name + '_stats {\n')
for l in stats:
@@ -32,8 +34,9 @@ for line in open('../src/include/stat.h', 'r'):
elif line.count('Statistics section: BEGIN'):
f.write('\n')
skip = 1
- print_struct('data sources', 'dsrc', dsrc_stats)
- print_struct('connections', 'connection', connection_stats)
+ print_struct(
+ 'connections', 'connection', 1000, connection_stats)
+ print_struct('data sources', 'dsrc', 2000, dsrc_stats)
f.close()
compare_srcfile(tmp_file, '../src/include/stat.h')
@@ -50,7 +53,7 @@ def print_defines():
* @{
*/
''')
- for v, l in enumerate(connection_stats):
+ for v, l in enumerate(connection_stats, 1000):
f.write('/*! %s */\n' % '\n * '.join(textwrap.wrap(l.desc, 70)))
f.write('#define\tWT_STAT_CONN_' + l.name.upper() + "\t" *
max(1, 6 - int((len('WT_STAT_CONN_' + l.name)) / 8)) +
@@ -63,7 +66,7 @@ def print_defines():
* @{
*/
''')
- for v, l in enumerate(dsrc_stats):
+ for v, l in enumerate(dsrc_stats, 2000):
f.write('/*! %s */\n' % '\n * '.join(textwrap.wrap(l.desc, 70)))
f.write('#define\tWT_STAT_DSRC_' + l.name.upper() + "\t" *
max(1, 6 - int((len('WT_STAT_DSRC_' + l.name)) / 8)) +
diff --git a/src/cursor/cur_stat.c b/src/cursor/cur_stat.c
index 01c39f5f96e..fc0969a7974 100644
--- a/src/cursor/cur_stat.c
+++ b/src/cursor/cur_stat.c
@@ -11,6 +11,15 @@ static int __curstat_next(WT_CURSOR *cursor);
static int __curstat_prev(WT_CURSOR *cursor);
/*
+ * The statistics identifier is an offset from a base to ensure the integer ID
+ * values don't overlap (the idea is if they overlap it's easy for application
+ * writers to confuse them).
+ */
+#define WT_STAT_KEY_MAX(cst) (((cst)->stats_base + (cst)->stats_count) - 1)
+#define WT_STAT_KEY_MIN(cst) ((cst)->stats_base)
+#define WT_STAT_KEY_OFFSET(cst) ((cst)->key - (cst)->stats_base)
+
+/*
* __curstat_print_value --
* Convert statistics cursor value to printable format.
*/
@@ -91,11 +100,13 @@ __curstat_get_value(WT_CURSOR *cursor, ...)
if (F_ISSET(cursor, WT_CURSTD_RAW)) {
WT_ERR(__wt_struct_size(session, &size, cursor->value_format,
- cst->stats_first[cst->key].desc, cst->pv.data, cst->v));
+ cst->stats_first[WT_STAT_KEY_OFFSET(cst)].desc,
+ cst->pv.data, cst->v));
WT_ERR(__wt_buf_initsize(session, &cursor->value, size));
WT_ERR(__wt_struct_pack(session, cursor->value.mem, size,
cursor->value_format,
- cst->stats_first[cst->key].desc, cst->pv.data, cst->v));
+ cst->stats_first[WT_STAT_KEY_OFFSET(cst)].desc,
+ cst->pv.data, cst->v));
item = va_arg(ap, WT_ITEM *);
item->data = cursor->value.data;
@@ -106,7 +117,7 @@ __curstat_get_value(WT_CURSOR *cursor, ...)
* pointer support isn't documented, but it's a cheap test.
*/
if ((p = va_arg(ap, const char **)) != NULL)
- *p = cst->stats_first[cst->key].desc;
+ *p = cst->stats_first[WT_STAT_KEY_OFFSET(cst)].desc;
if ((p = va_arg(ap, const char **)) != NULL)
*p = cst->pv.data;
if ((v = va_arg(ap, uint64_t *)) != NULL)
@@ -178,14 +189,14 @@ __curstat_next(WT_CURSOR *cursor)
/* Move to the next item. */
if (cst->notpositioned) {
cst->notpositioned = 0;
- cst->key = 0;
- } else if (cst->key < cst->stats_count - 1)
+ cst->key = WT_STAT_KEY_MIN(cst);
+ } else if (cst->key < WT_STAT_KEY_MAX(cst))
++cst->key;
else {
F_CLR(cursor, WT_CURSTD_KEY_SET | WT_CURSTD_VALUE_SET);
WT_ERR(WT_NOTFOUND);
}
- cst->v = cst->stats_first[cst->key].v;
+ cst->v = cst->stats_first[WT_STAT_KEY_OFFSET(cst)].v;
WT_ERR(__curstat_print_value(session, cst->v, &cst->pv));
F_SET(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT);
@@ -210,15 +221,15 @@ __curstat_prev(WT_CURSOR *cursor)
/* Move to the previous item. */
if (cst->notpositioned) {
cst->notpositioned = 0;
- cst->key = cst->stats_count - 1;
- } else if (cst->key > 0)
+ cst->key = WT_STAT_KEY_MAX(cst);
+ } else if (cst->key > WT_STAT_KEY_MIN(cst))
--cst->key;
else {
F_CLR(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT);
WT_ERR(WT_NOTFOUND);
}
- cst->v = cst->stats_first[cst->key].v;
+ cst->v = cst->stats_first[WT_STAT_KEY_OFFSET(cst)].v;
WT_ERR(__curstat_print_value(session, cst->v, &cst->pv));
F_SET(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT);
@@ -264,10 +275,10 @@ __curstat_search(WT_CURSOR *cursor)
WT_CURSOR_NEEDKEY(cursor);
F_CLR(cursor, WT_CURSTD_VALUE_SET | WT_CURSTD_VALUE_SET);
- if (cst->key < 0 || cst->key >= cst->stats_count)
+ if (cst->key < WT_STAT_KEY_MIN(cst) || cst->key > WT_STAT_KEY_MAX(cst))
WT_ERR(WT_NOTFOUND);
- cst->v = cst->stats_first[cst->key].v;
+ cst->v = cst->stats_first[WT_STAT_KEY_OFFSET(cst)].v;
WT_ERR(__curstat_print_value(session, cst->v, &cst->pv));
F_SET(cursor, WT_CURSTD_KEY_INT | WT_CURSTD_VALUE_INT);
@@ -318,6 +329,7 @@ __curstat_conn_init(WT_SESSION_IMPL *session, WT_CURSOR_STAT *cst)
__wt_stat_refresh_connection_stats(&conn->stats);
cst->stats_first = cst->stats = (WT_STATS *)&cst->u.conn_stats;
+ cst->stats_base = WT_CONNECTION_STATS_BASE;
cst->stats_count = sizeof(WT_CONNECTION_STATS) / sizeof(WT_STATS);
}
@@ -381,9 +393,7 @@ __curstat_file_init(WT_SESSION_IMPL *session,
cst->u.dsrc_stats = dhandle->stats;
if (cst->stat_clear)
__wt_stat_refresh_dsrc_stats(&dhandle->stats);
-
- cst->stats_first = cst->stats = (WT_STATS *)&cst->u.dsrc_stats;
- cst->stats_count = sizeof(WT_DSRC_STATS) / sizeof(WT_STATS);
+ __wt_curstat_dsrc_final(cst);
}
/* Release the handle, we're done with it. */
@@ -416,6 +426,19 @@ __curstat_file_init(WT_SESSION_IMPL *session,
}
/*
+ * __wt_curstat_dsrc_final --
+ * Finalize a data-source statistics cursor.
+ */
+void
+__wt_curstat_dsrc_final(WT_CURSOR_STAT *cst)
+{
+
+ cst->stats_first = cst->stats = (WT_STATS *)&cst->u.dsrc_stats;
+ cst->stats_base = WT_DSRC_STATS_BASE;
+ cst->stats_count = sizeof(WT_DSRC_STATS) / sizeof(WT_STATS);
+}
+
+/*
* __wt_curstat_init --
* Initialize a statistics cursor.
*/
diff --git a/src/include/cursor.h b/src/include/cursor.h
index b2595175b7b..0fe5bbeed4e 100644
--- a/src/include/cursor.h
+++ b/src/include/cursor.h
@@ -236,6 +236,7 @@ struct __wt_cursor_stat {
WT_STATS *stats; /* Stats owned by the cursor */
WT_STATS *stats_first; /* First stats reference */
+ int stats_base; /* Base statistics value */
int stats_count; /* Count of stats elements */
union { /* Copies of the statistics */
diff --git a/src/include/extern.h b/src/include/extern.h
index 1576935c845..101be45994a 100644
--- a/src/include/extern.h
+++ b/src/include/extern.h
@@ -636,6 +636,7 @@ extern int __wt_curindex_open(WT_SESSION_IMPL *session,
WT_CURSOR *owner,
const char *cfg[],
WT_CURSOR **cursorp);
+extern void __wt_curstat_dsrc_final(WT_CURSOR_STAT *cst);
extern int __wt_curstat_init(WT_SESSION_IMPL *session,
const char *uri,
const char *cfg[],
diff --git a/src/include/stat.h b/src/include/stat.h
index 3349ce146e6..94a6e869be9 100644
--- a/src/include/stat.h
+++ b/src/include/stat.h
@@ -113,8 +113,93 @@ struct __wt_stats {
/* Statistics section: BEGIN */
/*
+ * Statistics entries for connections.
+ */
+#define WT_CONNECTION_STATS_BASE 1000
+struct __wt_connection_stats {
+ WT_STATS block_byte_map_read;
+ WT_STATS block_byte_read;
+ WT_STATS block_byte_write;
+ WT_STATS block_map_read;
+ WT_STATS block_preload;
+ WT_STATS block_read;
+ WT_STATS block_write;
+ WT_STATS cache_bytes_dirty;
+ WT_STATS cache_bytes_inuse;
+ WT_STATS cache_bytes_max;
+ WT_STATS cache_bytes_read;
+ WT_STATS cache_bytes_write;
+ WT_STATS cache_eviction_checkpoint;
+ WT_STATS cache_eviction_clean;
+ WT_STATS cache_eviction_dirty;
+ WT_STATS cache_eviction_fail;
+ WT_STATS cache_eviction_force;
+ WT_STATS cache_eviction_force_fail;
+ WT_STATS cache_eviction_hazard;
+ WT_STATS cache_eviction_internal;
+ WT_STATS cache_eviction_merge;
+ WT_STATS cache_eviction_merge_fail;
+ WT_STATS cache_eviction_merge_levels;
+ WT_STATS cache_eviction_slow;
+ WT_STATS cache_eviction_walk;
+ WT_STATS cache_inmem_split;
+ WT_STATS cache_pages_dirty;
+ WT_STATS cache_pages_inuse;
+ WT_STATS cache_read;
+ WT_STATS cache_write;
+ WT_STATS cond_wait;
+ WT_STATS cursor_create;
+ WT_STATS cursor_insert;
+ WT_STATS cursor_next;
+ WT_STATS cursor_prev;
+ WT_STATS cursor_remove;
+ WT_STATS cursor_reset;
+ WT_STATS cursor_search;
+ WT_STATS cursor_search_near;
+ WT_STATS cursor_update;
+ WT_STATS dh_conn_handles;
+ WT_STATS dh_session_handles;
+ WT_STATS dh_sweep_evict;
+ WT_STATS dh_sweeps;
+ WT_STATS file_open;
+ WT_STATS log_bytes_user;
+ WT_STATS log_bytes_written;
+ WT_STATS log_max_filesize;
+ WT_STATS log_reads;
+ WT_STATS log_scan_records;
+ WT_STATS log_scan_rereads;
+ WT_STATS log_scans;
+ WT_STATS log_slot_closes;
+ WT_STATS log_slot_consolidated;
+ WT_STATS log_slot_joins;
+ WT_STATS log_slot_races;
+ WT_STATS log_slot_toobig;
+ WT_STATS log_slot_transitions;
+ WT_STATS log_sync;
+ WT_STATS log_writes;
+ WT_STATS lsm_rows_merged;
+ WT_STATS memory_allocation;
+ WT_STATS memory_free;
+ WT_STATS memory_grow;
+ WT_STATS read_io;
+ WT_STATS rec_pages;
+ WT_STATS rec_pages_eviction;
+ WT_STATS rec_skipped_update;
+ WT_STATS rwlock_read;
+ WT_STATS rwlock_write;
+ WT_STATS session_cursor_open;
+ WT_STATS txn_begin;
+ WT_STATS txn_checkpoint;
+ WT_STATS txn_commit;
+ WT_STATS txn_fail_cache;
+ WT_STATS txn_rollback;
+ WT_STATS write_io;
+};
+
+/*
* Statistics entries for data sources.
*/
+#define WT_DSRC_STATS_BASE 2000
struct __wt_dsrc_stats {
WT_STATS allocation_size;
WT_STATS block_alloc;
@@ -204,87 +289,4 @@ struct __wt_dsrc_stats {
WT_STATS txn_update_conflict;
};
-/*
- * Statistics entries for connections.
- */
-struct __wt_connection_stats {
- WT_STATS block_byte_map_read;
- WT_STATS block_byte_read;
- WT_STATS block_byte_write;
- WT_STATS block_map_read;
- WT_STATS block_preload;
- WT_STATS block_read;
- WT_STATS block_write;
- WT_STATS cache_bytes_dirty;
- WT_STATS cache_bytes_inuse;
- WT_STATS cache_bytes_max;
- WT_STATS cache_bytes_read;
- WT_STATS cache_bytes_write;
- WT_STATS cache_eviction_checkpoint;
- WT_STATS cache_eviction_clean;
- WT_STATS cache_eviction_dirty;
- WT_STATS cache_eviction_fail;
- WT_STATS cache_eviction_force;
- WT_STATS cache_eviction_force_fail;
- WT_STATS cache_eviction_hazard;
- WT_STATS cache_eviction_internal;
- WT_STATS cache_eviction_merge;
- WT_STATS cache_eviction_merge_fail;
- WT_STATS cache_eviction_merge_levels;
- WT_STATS cache_eviction_slow;
- WT_STATS cache_eviction_walk;
- WT_STATS cache_inmem_split;
- WT_STATS cache_pages_dirty;
- WT_STATS cache_pages_inuse;
- WT_STATS cache_read;
- WT_STATS cache_write;
- WT_STATS cond_wait;
- WT_STATS cursor_create;
- WT_STATS cursor_insert;
- WT_STATS cursor_next;
- WT_STATS cursor_prev;
- WT_STATS cursor_remove;
- WT_STATS cursor_reset;
- WT_STATS cursor_search;
- WT_STATS cursor_search_near;
- WT_STATS cursor_update;
- WT_STATS dh_conn_handles;
- WT_STATS dh_session_handles;
- WT_STATS dh_sweep_evict;
- WT_STATS dh_sweeps;
- WT_STATS file_open;
- WT_STATS log_bytes_user;
- WT_STATS log_bytes_written;
- WT_STATS log_max_filesize;
- WT_STATS log_reads;
- WT_STATS log_scan_records;
- WT_STATS log_scan_rereads;
- WT_STATS log_scans;
- WT_STATS log_slot_closes;
- WT_STATS log_slot_consolidated;
- WT_STATS log_slot_joins;
- WT_STATS log_slot_races;
- WT_STATS log_slot_toobig;
- WT_STATS log_slot_transitions;
- WT_STATS log_sync;
- WT_STATS log_writes;
- WT_STATS lsm_rows_merged;
- WT_STATS memory_allocation;
- WT_STATS memory_free;
- WT_STATS memory_grow;
- WT_STATS read_io;
- WT_STATS rec_pages;
- WT_STATS rec_pages_eviction;
- WT_STATS rec_skipped_update;
- WT_STATS rwlock_read;
- WT_STATS rwlock_write;
- WT_STATS session_cursor_open;
- WT_STATS txn_begin;
- WT_STATS txn_checkpoint;
- WT_STATS txn_commit;
- WT_STATS txn_fail_cache;
- WT_STATS txn_rollback;
- WT_STATS write_io;
-};
-
/* Statistics section: END */
diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in
index 659804f39f3..e64d0bcab68 100644
--- a/src/include/wiredtiger.in
+++ b/src/include/wiredtiger.in
@@ -2396,159 +2396,159 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection);
* @{
*/
/*! block manager: mapped bytes read */
-#define WT_STAT_CONN_BLOCK_BYTE_MAP_READ 0
+#define WT_STAT_CONN_BLOCK_BYTE_MAP_READ 1000
/*! block manager: bytes read */
-#define WT_STAT_CONN_BLOCK_BYTE_READ 1
+#define WT_STAT_CONN_BLOCK_BYTE_READ 1001
/*! block manager: bytes written */
-#define WT_STAT_CONN_BLOCK_BYTE_WRITE 2
+#define WT_STAT_CONN_BLOCK_BYTE_WRITE 1002
/*! block manager: mapped blocks read */
-#define WT_STAT_CONN_BLOCK_MAP_READ 3
+#define WT_STAT_CONN_BLOCK_MAP_READ 1003
/*! block manager: blocks pre-loaded */
-#define WT_STAT_CONN_BLOCK_PRELOAD 4
+#define WT_STAT_CONN_BLOCK_PRELOAD 1004
/*! block manager: blocks read */
-#define WT_STAT_CONN_BLOCK_READ 5
+#define WT_STAT_CONN_BLOCK_READ 1005
/*! block manager: blocks written */
-#define WT_STAT_CONN_BLOCK_WRITE 6
+#define WT_STAT_CONN_BLOCK_WRITE 1006
/*! cache: tracked dirty bytes in the cache */
-#define WT_STAT_CONN_CACHE_BYTES_DIRTY 7
+#define WT_STAT_CONN_CACHE_BYTES_DIRTY 1007
/*! cache: bytes currently in the cache */
-#define WT_STAT_CONN_CACHE_BYTES_INUSE 8
+#define WT_STAT_CONN_CACHE_BYTES_INUSE 1008
/*! cache: maximum bytes configured */
-#define WT_STAT_CONN_CACHE_BYTES_MAX 9
+#define WT_STAT_CONN_CACHE_BYTES_MAX 1009
/*! cache: bytes read into cache */
-#define WT_STAT_CONN_CACHE_BYTES_READ 10
+#define WT_STAT_CONN_CACHE_BYTES_READ 1010
/*! cache: bytes written from cache */
-#define WT_STAT_CONN_CACHE_BYTES_WRITE 11
+#define WT_STAT_CONN_CACHE_BYTES_WRITE 1011
/*! cache: checkpoint blocked page eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_CHECKPOINT 12
+#define WT_STAT_CONN_CACHE_EVICTION_CHECKPOINT 1012
/*! cache: unmodified pages evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 13
+#define WT_STAT_CONN_CACHE_EVICTION_CLEAN 1013
/*! cache: modified pages evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 14
+#define WT_STAT_CONN_CACHE_EVICTION_DIRTY 1014
/*! cache: pages selected for eviction unable to be evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_FAIL 15
+#define WT_STAT_CONN_CACHE_EVICTION_FAIL 1015
/*! cache: pages evicted because they exceeded the in memory maximum */
-#define WT_STAT_CONN_CACHE_EVICTION_FORCE 16
+#define WT_STAT_CONN_CACHE_EVICTION_FORCE 1016
/*! cache: failed eviction of pages that exceeded the in memory maximum */
-#define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL 17
+#define WT_STAT_CONN_CACHE_EVICTION_FORCE_FAIL 1017
/*! cache: hazard pointer blocked page eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 18
+#define WT_STAT_CONN_CACHE_EVICTION_HAZARD 1018
/*! cache: internal pages evicted */
-#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 19
+#define WT_STAT_CONN_CACHE_EVICTION_INTERNAL 1019
/*! cache: internal page merge operations completed */
-#define WT_STAT_CONN_CACHE_EVICTION_MERGE 20
+#define WT_STAT_CONN_CACHE_EVICTION_MERGE 1020
/*! cache: internal page merge attempts that could not complete */
-#define WT_STAT_CONN_CACHE_EVICTION_MERGE_FAIL 21
+#define WT_STAT_CONN_CACHE_EVICTION_MERGE_FAIL 1021
/*! cache: internal levels merged */
-#define WT_STAT_CONN_CACHE_EVICTION_MERGE_LEVELS 22
+#define WT_STAT_CONN_CACHE_EVICTION_MERGE_LEVELS 1022
/*! cache: eviction server unable to reach eviction goal */
-#define WT_STAT_CONN_CACHE_EVICTION_SLOW 23
+#define WT_STAT_CONN_CACHE_EVICTION_SLOW 1023
/*! cache: pages walked for eviction */
-#define WT_STAT_CONN_CACHE_EVICTION_WALK 24
+#define WT_STAT_CONN_CACHE_EVICTION_WALK 1024
/*! pages split because they were unable to be evicted */
-#define WT_STAT_CONN_CACHE_INMEM_SPLIT 25
+#define WT_STAT_CONN_CACHE_INMEM_SPLIT 1025
/*! cache: tracked dirty pages in the cache */
-#define WT_STAT_CONN_CACHE_PAGES_DIRTY 26
+#define WT_STAT_CONN_CACHE_PAGES_DIRTY 1026
/*! cache: pages currently held in the cache */
-#define WT_STAT_CONN_CACHE_PAGES_INUSE 27
+#define WT_STAT_CONN_CACHE_PAGES_INUSE 1027
/*! cache: pages read into cache */
-#define WT_STAT_CONN_CACHE_READ 28
+#define WT_STAT_CONN_CACHE_READ 1028
/*! cache: pages written from cache */
-#define WT_STAT_CONN_CACHE_WRITE 29
+#define WT_STAT_CONN_CACHE_WRITE 1029
/*! pthread mutex condition wait calls */
-#define WT_STAT_CONN_COND_WAIT 30
+#define WT_STAT_CONN_COND_WAIT 1030
/*! cursor creation */
-#define WT_STAT_CONN_CURSOR_CREATE 31
+#define WT_STAT_CONN_CURSOR_CREATE 1031
/*! Btree cursor insert calls */
-#define WT_STAT_CONN_CURSOR_INSERT 32
+#define WT_STAT_CONN_CURSOR_INSERT 1032
/*! Btree cursor next calls */
-#define WT_STAT_CONN_CURSOR_NEXT 33
+#define WT_STAT_CONN_CURSOR_NEXT 1033
/*! Btree cursor prev calls */
-#define WT_STAT_CONN_CURSOR_PREV 34
+#define WT_STAT_CONN_CURSOR_PREV 1034
/*! Btree cursor remove calls */
-#define WT_STAT_CONN_CURSOR_REMOVE 35
+#define WT_STAT_CONN_CURSOR_REMOVE 1035
/*! Btree cursor reset calls */
-#define WT_STAT_CONN_CURSOR_RESET 36
+#define WT_STAT_CONN_CURSOR_RESET 1036
/*! Btree cursor search calls */
-#define WT_STAT_CONN_CURSOR_SEARCH 37
+#define WT_STAT_CONN_CURSOR_SEARCH 1037
/*! Btree cursor search near calls */
-#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 38
+#define WT_STAT_CONN_CURSOR_SEARCH_NEAR 1038
/*! Btree cursor update calls */
-#define WT_STAT_CONN_CURSOR_UPDATE 39
+#define WT_STAT_CONN_CURSOR_UPDATE 1039
/*! dhandle: connection dhandles swept */
-#define WT_STAT_CONN_DH_CONN_HANDLES 40
+#define WT_STAT_CONN_DH_CONN_HANDLES 1040
/*! dhandle: session dhandles swept */
-#define WT_STAT_CONN_DH_SESSION_HANDLES 41
+#define WT_STAT_CONN_DH_SESSION_HANDLES 1041
/*! dhandle: sweeps conflicting with evict */
-#define WT_STAT_CONN_DH_SWEEP_EVICT 42
+#define WT_STAT_CONN_DH_SWEEP_EVICT 1042
/*! dhandle: number of sweep attempts */
-#define WT_STAT_CONN_DH_SWEEPS 43
+#define WT_STAT_CONN_DH_SWEEPS 1043
/*! files currently open */
-#define WT_STAT_CONN_FILE_OPEN 44
+#define WT_STAT_CONN_FILE_OPEN 1044
/*! log: user provided log bytes written */
-#define WT_STAT_CONN_LOG_BYTES_USER 45
+#define WT_STAT_CONN_LOG_BYTES_USER 1045
/*! log: log bytes written */
-#define WT_STAT_CONN_LOG_BYTES_WRITTEN 46
+#define WT_STAT_CONN_LOG_BYTES_WRITTEN 1046
/*! log: maximum log file size */
-#define WT_STAT_CONN_LOG_MAX_FILESIZE 47
+#define WT_STAT_CONN_LOG_MAX_FILESIZE 1047
/*! log: log read operations */
-#define WT_STAT_CONN_LOG_READS 48
+#define WT_STAT_CONN_LOG_READS 1048
/*! log: records processed by log scan */
-#define WT_STAT_CONN_LOG_SCAN_RECORDS 49
+#define WT_STAT_CONN_LOG_SCAN_RECORDS 1049
/*! log: log scan records requiring two reads */
-#define WT_STAT_CONN_LOG_SCAN_REREADS 50
+#define WT_STAT_CONN_LOG_SCAN_REREADS 1050
/*! log: log scan operations */
-#define WT_STAT_CONN_LOG_SCANS 51
+#define WT_STAT_CONN_LOG_SCANS 1051
/*! log: consolidated slot closures */
-#define WT_STAT_CONN_LOG_SLOT_CLOSES 52
+#define WT_STAT_CONN_LOG_SLOT_CLOSES 1052
/*! log: logging bytes consolidated */
-#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 53
+#define WT_STAT_CONN_LOG_SLOT_CONSOLIDATED 1053
/*! log: consolidated slot joins */
-#define WT_STAT_CONN_LOG_SLOT_JOINS 54
+#define WT_STAT_CONN_LOG_SLOT_JOINS 1054
/*! log: consolidated slot join races */
-#define WT_STAT_CONN_LOG_SLOT_RACES 55
+#define WT_STAT_CONN_LOG_SLOT_RACES 1055
/*! log: record size exceeded maximum */
-#define WT_STAT_CONN_LOG_SLOT_TOOBIG 56
+#define WT_STAT_CONN_LOG_SLOT_TOOBIG 1056
/*! log: consolidated slot join transitions */
-#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 57
+#define WT_STAT_CONN_LOG_SLOT_TRANSITIONS 1057
/*! log: log sync operations */
-#define WT_STAT_CONN_LOG_SYNC 58
+#define WT_STAT_CONN_LOG_SYNC 1058
/*! log: log write operations */
-#define WT_STAT_CONN_LOG_WRITES 59
+#define WT_STAT_CONN_LOG_WRITES 1059
/*! rows merged in an LSM tree */
-#define WT_STAT_CONN_LSM_ROWS_MERGED 60
+#define WT_STAT_CONN_LSM_ROWS_MERGED 1060
/*! memory allocations */
-#define WT_STAT_CONN_MEMORY_ALLOCATION 61
+#define WT_STAT_CONN_MEMORY_ALLOCATION 1061
/*! memory frees */
-#define WT_STAT_CONN_MEMORY_FREE 62
+#define WT_STAT_CONN_MEMORY_FREE 1062
/*! memory re-allocations */
-#define WT_STAT_CONN_MEMORY_GROW 63
+#define WT_STAT_CONN_MEMORY_GROW 1063
/*! total read I/Os */
-#define WT_STAT_CONN_READ_IO 64
+#define WT_STAT_CONN_READ_IO 1064
/*! page reconciliation calls */
-#define WT_STAT_CONN_REC_PAGES 65
+#define WT_STAT_CONN_REC_PAGES 1065
/*! page reconciliation calls for eviction */
-#define WT_STAT_CONN_REC_PAGES_EVICTION 66
+#define WT_STAT_CONN_REC_PAGES_EVICTION 1066
/*! reconciliation failed because an update could not be included */
-#define WT_STAT_CONN_REC_SKIPPED_UPDATE 67
+#define WT_STAT_CONN_REC_SKIPPED_UPDATE 1067
/*! pthread mutex shared lock read-lock calls */
-#define WT_STAT_CONN_RWLOCK_READ 68
+#define WT_STAT_CONN_RWLOCK_READ 1068
/*! pthread mutex shared lock write-lock calls */
-#define WT_STAT_CONN_RWLOCK_WRITE 69
+#define WT_STAT_CONN_RWLOCK_WRITE 1069
/*! open cursor count */
-#define WT_STAT_CONN_SESSION_CURSOR_OPEN 70
+#define WT_STAT_CONN_SESSION_CURSOR_OPEN 1070
/*! transactions */
-#define WT_STAT_CONN_TXN_BEGIN 71
+#define WT_STAT_CONN_TXN_BEGIN 1071
/*! transaction checkpoints */
-#define WT_STAT_CONN_TXN_CHECKPOINT 72
+#define WT_STAT_CONN_TXN_CHECKPOINT 1072
/*! transactions committed */
-#define WT_STAT_CONN_TXN_COMMIT 73
+#define WT_STAT_CONN_TXN_COMMIT 1073
/*! transaction failures due to cache overflow */
-#define WT_STAT_CONN_TXN_FAIL_CACHE 74
+#define WT_STAT_CONN_TXN_FAIL_CACHE 1074
/*! transactions rolled-back */
-#define WT_STAT_CONN_TXN_ROLLBACK 75
+#define WT_STAT_CONN_TXN_ROLLBACK 1075
/*! total write I/Os */
-#define WT_STAT_CONN_WRITE_IO 76
+#define WT_STAT_CONN_WRITE_IO 1076
/*!
* @}
@@ -2557,178 +2557,178 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection);
* @{
*/
/*! block manager: file allocation unit size */
-#define WT_STAT_DSRC_ALLOCATION_SIZE 0
+#define WT_STAT_DSRC_ALLOCATION_SIZE 2000
/*! block manager: blocks allocated */
-#define WT_STAT_DSRC_BLOCK_ALLOC 1
+#define WT_STAT_DSRC_BLOCK_ALLOC 2001
/*! block manager: checkpoint size */
-#define WT_STAT_DSRC_BLOCK_CHECKPOINT_SIZE 2
+#define WT_STAT_DSRC_BLOCK_CHECKPOINT_SIZE 2002
/*! block manager: allocations requiring file extension */
-#define WT_STAT_DSRC_BLOCK_EXTENSION 3
+#define WT_STAT_DSRC_BLOCK_EXTENSION 2003
/*! block manager: blocks freed */
-#define WT_STAT_DSRC_BLOCK_FREE 4
+#define WT_STAT_DSRC_BLOCK_FREE 2004
/*! block manager: file magic number */
-#define WT_STAT_DSRC_BLOCK_MAGIC 5
+#define WT_STAT_DSRC_BLOCK_MAGIC 2005
/*! block manager: file major version number */
-#define WT_STAT_DSRC_BLOCK_MAJOR 6
+#define WT_STAT_DSRC_BLOCK_MAJOR 2006
/*! block manager: minor version number */
-#define WT_STAT_DSRC_BLOCK_MINOR 7
+#define WT_STAT_DSRC_BLOCK_MINOR 2007
/*! block manager: file bytes available for reuse */
-#define WT_STAT_DSRC_BLOCK_REUSE_BYTES 8
+#define WT_STAT_DSRC_BLOCK_REUSE_BYTES 2008
/*! block manager: file size in bytes */
-#define WT_STAT_DSRC_BLOCK_SIZE 9
+#define WT_STAT_DSRC_BLOCK_SIZE 2009
/*! bloom filters in the LSM tree */
-#define WT_STAT_DSRC_BLOOM_COUNT 10
+#define WT_STAT_DSRC_BLOOM_COUNT 2010
/*! bloom filter false positives */
-#define WT_STAT_DSRC_BLOOM_FALSE_POSITIVE 11
+#define WT_STAT_DSRC_BLOOM_FALSE_POSITIVE 2011
/*! bloom filter hits */
-#define WT_STAT_DSRC_BLOOM_HIT 12
+#define WT_STAT_DSRC_BLOOM_HIT 2012
/*! bloom filter misses */
-#define WT_STAT_DSRC_BLOOM_MISS 13
+#define WT_STAT_DSRC_BLOOM_MISS 2013
/*! bloom filter pages evicted from cache */
-#define WT_STAT_DSRC_BLOOM_PAGE_EVICT 14
+#define WT_STAT_DSRC_BLOOM_PAGE_EVICT 2014
/*! bloom filter pages read into cache */
-#define WT_STAT_DSRC_BLOOM_PAGE_READ 15
+#define WT_STAT_DSRC_BLOOM_PAGE_READ 2015
/*! total size of bloom filters */
-#define WT_STAT_DSRC_BLOOM_SIZE 16
+#define WT_STAT_DSRC_BLOOM_SIZE 2016
/*! column-store variable-size deleted values */
-#define WT_STAT_DSRC_BTREE_COLUMN_DELETED 17
+#define WT_STAT_DSRC_BTREE_COLUMN_DELETED 2017
/*! column-store fixed-size leaf pages */
-#define WT_STAT_DSRC_BTREE_COLUMN_FIX 18
+#define WT_STAT_DSRC_BTREE_COLUMN_FIX 2018
/*! column-store internal pages */
-#define WT_STAT_DSRC_BTREE_COLUMN_INTERNAL 19
+#define WT_STAT_DSRC_BTREE_COLUMN_INTERNAL 2019
/*! column-store variable-size leaf pages */
-#define WT_STAT_DSRC_BTREE_COLUMN_VARIABLE 20
+#define WT_STAT_DSRC_BTREE_COLUMN_VARIABLE 2020
/*! pages rewritten by compaction */
-#define WT_STAT_DSRC_BTREE_COMPACT_REWRITE 21
+#define WT_STAT_DSRC_BTREE_COMPACT_REWRITE 2021
/*! total LSM, table or file object key/value pairs */
-#define WT_STAT_DSRC_BTREE_ENTRIES 22
+#define WT_STAT_DSRC_BTREE_ENTRIES 2022
/*! fixed-record size */
-#define WT_STAT_DSRC_BTREE_FIXED_LEN 23
+#define WT_STAT_DSRC_BTREE_FIXED_LEN 2023
/*! maximum tree depth */
-#define WT_STAT_DSRC_BTREE_MAXIMUM_DEPTH 24
+#define WT_STAT_DSRC_BTREE_MAXIMUM_DEPTH 2024
/*! maximum internal page item size */
-#define WT_STAT_DSRC_BTREE_MAXINTLITEM 25
+#define WT_STAT_DSRC_BTREE_MAXINTLITEM 2025
/*! maximum internal page size */
-#define WT_STAT_DSRC_BTREE_MAXINTLPAGE 26
+#define WT_STAT_DSRC_BTREE_MAXINTLPAGE 2026
/*! maximum leaf page item size */
-#define WT_STAT_DSRC_BTREE_MAXLEAFITEM 27
+#define WT_STAT_DSRC_BTREE_MAXLEAFITEM 2027
/*! maximum leaf page size */
-#define WT_STAT_DSRC_BTREE_MAXLEAFPAGE 28
+#define WT_STAT_DSRC_BTREE_MAXLEAFPAGE 2028
/*! overflow pages */
-#define WT_STAT_DSRC_BTREE_OVERFLOW 29
+#define WT_STAT_DSRC_BTREE_OVERFLOW 2029
/*! row-store internal pages */
-#define WT_STAT_DSRC_BTREE_ROW_INTERNAL 30
+#define WT_STAT_DSRC_BTREE_ROW_INTERNAL 2030
/*! row-store leaf pages */
-#define WT_STAT_DSRC_BTREE_ROW_LEAF 31
+#define WT_STAT_DSRC_BTREE_ROW_LEAF 2031
/*! bytes read into cache */
-#define WT_STAT_DSRC_CACHE_BYTES_READ 32
+#define WT_STAT_DSRC_CACHE_BYTES_READ 2032
/*! bytes written from cache */
-#define WT_STAT_DSRC_CACHE_BYTES_WRITE 33
+#define WT_STAT_DSRC_CACHE_BYTES_WRITE 2033
/*! cache: checkpoint blocked page eviction */
-#define WT_STAT_DSRC_CACHE_EVICTION_CHECKPOINT 34
+#define WT_STAT_DSRC_CACHE_EVICTION_CHECKPOINT 2034
/*! unmodified pages evicted */
-#define WT_STAT_DSRC_CACHE_EVICTION_CLEAN 35
+#define WT_STAT_DSRC_CACHE_EVICTION_CLEAN 2035
/*! modified pages evicted */
-#define WT_STAT_DSRC_CACHE_EVICTION_DIRTY 36
+#define WT_STAT_DSRC_CACHE_EVICTION_DIRTY 2036
/*! data source pages selected for eviction unable to be evicted */
-#define WT_STAT_DSRC_CACHE_EVICTION_FAIL 37
+#define WT_STAT_DSRC_CACHE_EVICTION_FAIL 2037
/*! cache: hazard pointer blocked page eviction */
-#define WT_STAT_DSRC_CACHE_EVICTION_HAZARD 38
+#define WT_STAT_DSRC_CACHE_EVICTION_HAZARD 2038
/*! internal pages evicted */
-#define WT_STAT_DSRC_CACHE_EVICTION_INTERNAL 39
+#define WT_STAT_DSRC_CACHE_EVICTION_INTERNAL 2039
/*! cache: internal page merge operations completed */
-#define WT_STAT_DSRC_CACHE_EVICTION_MERGE 40
+#define WT_STAT_DSRC_CACHE_EVICTION_MERGE 2040
/*! cache: internal page merge attempts that could not complete */
-#define WT_STAT_DSRC_CACHE_EVICTION_MERGE_FAIL 41
+#define WT_STAT_DSRC_CACHE_EVICTION_MERGE_FAIL 2041
/*! cache: internal levels merged */
-#define WT_STAT_DSRC_CACHE_EVICTION_MERGE_LEVELS 42
+#define WT_STAT_DSRC_CACHE_EVICTION_MERGE_LEVELS 2042
/*! pages split because they were unable to be evicted */
-#define WT_STAT_DSRC_CACHE_INMEM_SPLIT 43
+#define WT_STAT_DSRC_CACHE_INMEM_SPLIT 2043
/*! overflow values cached in memory */
-#define WT_STAT_DSRC_CACHE_OVERFLOW_VALUE 44
+#define WT_STAT_DSRC_CACHE_OVERFLOW_VALUE 2044
/*! pages read into cache */
-#define WT_STAT_DSRC_CACHE_READ 45
+#define WT_STAT_DSRC_CACHE_READ 2045
/*! overflow pages read into cache */
-#define WT_STAT_DSRC_CACHE_READ_OVERFLOW 46
+#define WT_STAT_DSRC_CACHE_READ_OVERFLOW 2046
/*! pages written from cache */
-#define WT_STAT_DSRC_CACHE_WRITE 47
+#define WT_STAT_DSRC_CACHE_WRITE 2047
/*! raw compression call failed, no additional data available */
-#define WT_STAT_DSRC_COMPRESS_RAW_FAIL 48
+#define WT_STAT_DSRC_COMPRESS_RAW_FAIL 2048
/*! raw compression call failed, additional data available */
-#define WT_STAT_DSRC_COMPRESS_RAW_FAIL_TEMPORARY 49
+#define WT_STAT_DSRC_COMPRESS_RAW_FAIL_TEMPORARY 2049
/*! raw compression call succeeded */
-#define WT_STAT_DSRC_COMPRESS_RAW_OK 50
+#define WT_STAT_DSRC_COMPRESS_RAW_OK 2050
/*! compressed pages read */
-#define WT_STAT_DSRC_COMPRESS_READ 51
+#define WT_STAT_DSRC_COMPRESS_READ 2051
/*! compressed pages written */
-#define WT_STAT_DSRC_COMPRESS_WRITE 52
+#define WT_STAT_DSRC_COMPRESS_WRITE 2052
/*! page written failed to compress */
-#define WT_STAT_DSRC_COMPRESS_WRITE_FAIL 53
+#define WT_STAT_DSRC_COMPRESS_WRITE_FAIL 2053
/*! page written was too small to compress */
-#define WT_STAT_DSRC_COMPRESS_WRITE_TOO_SMALL 54
+#define WT_STAT_DSRC_COMPRESS_WRITE_TOO_SMALL 2054
/*! cursor creation */
-#define WT_STAT_DSRC_CURSOR_CREATE 55
+#define WT_STAT_DSRC_CURSOR_CREATE 2055
/*! cursor insert calls */
-#define WT_STAT_DSRC_CURSOR_INSERT 56
+#define WT_STAT_DSRC_CURSOR_INSERT 2056
/*! bulk-loaded cursor-insert calls */
-#define WT_STAT_DSRC_CURSOR_INSERT_BULK 57
+#define WT_STAT_DSRC_CURSOR_INSERT_BULK 2057
/*! cursor-insert key and value bytes inserted */
-#define WT_STAT_DSRC_CURSOR_INSERT_BYTES 58
+#define WT_STAT_DSRC_CURSOR_INSERT_BYTES 2058
/*! cursor next calls */
-#define WT_STAT_DSRC_CURSOR_NEXT 59
+#define WT_STAT_DSRC_CURSOR_NEXT 2059
/*! cursor prev calls */
-#define WT_STAT_DSRC_CURSOR_PREV 60
+#define WT_STAT_DSRC_CURSOR_PREV 2060
/*! cursor remove calls */
-#define WT_STAT_DSRC_CURSOR_REMOVE 61
+#define WT_STAT_DSRC_CURSOR_REMOVE 2061
/*! cursor-remove key bytes removed */
-#define WT_STAT_DSRC_CURSOR_REMOVE_BYTES 62
+#define WT_STAT_DSRC_CURSOR_REMOVE_BYTES 2062
/*! cursor reset calls */
-#define WT_STAT_DSRC_CURSOR_RESET 63
+#define WT_STAT_DSRC_CURSOR_RESET 2063
/*! cursor search calls */
-#define WT_STAT_DSRC_CURSOR_SEARCH 64
+#define WT_STAT_DSRC_CURSOR_SEARCH 2064
/*! cursor search near calls */
-#define WT_STAT_DSRC_CURSOR_SEARCH_NEAR 65
+#define WT_STAT_DSRC_CURSOR_SEARCH_NEAR 2065
/*! cursor update calls */
-#define WT_STAT_DSRC_CURSOR_UPDATE 66
+#define WT_STAT_DSRC_CURSOR_UPDATE 2066
/*! cursor-update value bytes updated */
-#define WT_STAT_DSRC_CURSOR_UPDATE_BYTES 67
+#define WT_STAT_DSRC_CURSOR_UPDATE_BYTES 2067
/*! chunks in the LSM tree */
-#define WT_STAT_DSRC_LSM_CHUNK_COUNT 68
+#define WT_STAT_DSRC_LSM_CHUNK_COUNT 2068
/*! highest merge generation in the LSM tree */
-#define WT_STAT_DSRC_LSM_GENERATION_MAX 69
+#define WT_STAT_DSRC_LSM_GENERATION_MAX 2069
/*! queries that could have benefited from a Bloom filter that did not
* exist */
-#define WT_STAT_DSRC_LSM_LOOKUP_NO_BLOOM 70
+#define WT_STAT_DSRC_LSM_LOOKUP_NO_BLOOM 2070
/*! reconciliation dictionary matches */
-#define WT_STAT_DSRC_REC_DICTIONARY 71
+#define WT_STAT_DSRC_REC_DICTIONARY 2071
/*! reconciliation internal-page overflow keys */
-#define WT_STAT_DSRC_REC_OVERFLOW_KEY_INTERNAL 72
+#define WT_STAT_DSRC_REC_OVERFLOW_KEY_INTERNAL 2072
/*! reconciliation leaf-page overflow keys */
-#define WT_STAT_DSRC_REC_OVERFLOW_KEY_LEAF 73
+#define WT_STAT_DSRC_REC_OVERFLOW_KEY_LEAF 2073
/*! reconciliation overflow values written */
-#define WT_STAT_DSRC_REC_OVERFLOW_VALUE 74
+#define WT_STAT_DSRC_REC_OVERFLOW_VALUE 2074
/*! reconciliation pages deleted */
-#define WT_STAT_DSRC_REC_PAGE_DELETE 75
+#define WT_STAT_DSRC_REC_PAGE_DELETE 2075
/*! reconciliation pages merged */
-#define WT_STAT_DSRC_REC_PAGE_MERGE 76
+#define WT_STAT_DSRC_REC_PAGE_MERGE 2076
/*! page reconciliation calls */
-#define WT_STAT_DSRC_REC_PAGES 77
+#define WT_STAT_DSRC_REC_PAGES 2077
/*! page reconciliation calls for eviction */
-#define WT_STAT_DSRC_REC_PAGES_EVICTION 78
+#define WT_STAT_DSRC_REC_PAGES_EVICTION 2078
/*! reconciliation failed because an update could not be included */
-#define WT_STAT_DSRC_REC_SKIPPED_UPDATE 79
+#define WT_STAT_DSRC_REC_SKIPPED_UPDATE 2079
/*! reconciliation internal pages split */
-#define WT_STAT_DSRC_REC_SPLIT_INTERNAL 80
+#define WT_STAT_DSRC_REC_SPLIT_INTERNAL 2080
/*! reconciliation leaf pages split */
-#define WT_STAT_DSRC_REC_SPLIT_LEAF 81
+#define WT_STAT_DSRC_REC_SPLIT_LEAF 2081
/*! reconciliation maximum number of splits created for a page */
-#define WT_STAT_DSRC_REC_SPLIT_MAX 82
+#define WT_STAT_DSRC_REC_SPLIT_MAX 2082
/*! object compaction */
-#define WT_STAT_DSRC_SESSION_COMPACT 83
+#define WT_STAT_DSRC_SESSION_COMPACT 2083
/*! open cursor count */
-#define WT_STAT_DSRC_SESSION_CURSOR_OPEN 84
+#define WT_STAT_DSRC_SESSION_CURSOR_OPEN 2084
/*! update conflicts */
-#define WT_STAT_DSRC_TXN_UPDATE_CONFLICT 85
+#define WT_STAT_DSRC_TXN_UPDATE_CONFLICT 2085
/*! @} */
/*
* Statistics section: END
diff --git a/src/lsm/lsm_stat.c b/src/lsm/lsm_stat.c
index 3af4e18131f..cb3d2bba2ac 100644
--- a/src/lsm/lsm_stat.c
+++ b/src/lsm/lsm_stat.c
@@ -49,8 +49,6 @@ __lsm_stat_init(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR_STAT *cst)
* chunk's statistics, which has the same effect.
*/
stats = &cst->u.dsrc_stats;
- cst->stats_first = cst->stats = (WT_STATS *)stats;
- cst->stats_count = sizeof(WT_DSRC_STATS) / sizeof(WT_STATS);
/* Hold the LSM lock so that we can safely walk through the chunks. */
WT_ERR(__wt_lsm_tree_lock(session, lsm_tree, 0));
@@ -136,6 +134,8 @@ __lsm_stat_init(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR_STAT *cst)
if (cst->stat_clear)
__wt_stat_refresh_dsrc_stats(&lsm_tree->stats);
+ __wt_curstat_dsrc_final(cst);
+
err: if (locked)
WT_TRET(__wt_lsm_tree_unlock(session, lsm_tree));
__wt_lsm_tree_release(session, lsm_tree);
diff --git a/src/schema/schema_stat.c b/src/schema/schema_stat.c
index d0417475b2f..c81a70a4464 100644
--- a/src/schema/schema_stat.c
+++ b/src/schema/schema_stat.c
@@ -73,15 +73,13 @@ __wt_curstat_table_init(WT_SESSION_IMPL *session,
WT_ERR(__wt_scr_alloc(session, 0, &buf));
/*
+ * Process the column groups.
+ *
* Set the cursor to reference the data source statistics; we don't
* initialize it, instead we copy (rather than aggregate), the first
* column's statistics, which has the same effect.
*/
stats = &cst->u.dsrc_stats;
- cst->stats_first = cst->stats = (WT_STATS *)stats;
- cst->stats_count = sizeof(WT_DSRC_STATS) / sizeof(WT_STATS);
-
- /* Process the column groups. */
for (i = 0; i < WT_COLGROUPS(table); i++) {
WT_ERR(__wt_buf_fmt(
session, buf, "statistics:%s", table->cgroups[i]->name));
@@ -107,6 +105,8 @@ __wt_curstat_table_init(WT_SESSION_IMPL *session,
WT_ERR(stat_cursor->close(stat_cursor));
}
+ __wt_curstat_dsrc_final(cst);
+
err: __wt_schema_release_table(session, table);
__wt_scr_free(&buf);