diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-10-09 18:02:22 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-10-09 18:02:22 +1100 |
commit | 082a00872ffba53903b9ca6a532eae50e1094460 (patch) | |
tree | 6d2e3aa2995332ebd49add659e1ace753b404d97 | |
parent | 9a77aff9bdcd3e98d0d6a5fe0de9230fe8fb8418 (diff) | |
parent | 28f775c6262e7103661af2f2ba55b74ebfbbd466 (diff) | |
download | mongo-082a00872ffba53903b9ca6a532eae50e1094460.tar.gz |
Merge branch 'develop' into bloom-bulk-fastpath
-rw-r--r-- | dist/api_data.py | 4 | ||||
-rw-r--r-- | dist/s_string.ok | 6 | ||||
-rw-r--r-- | dist/stat_data.py | 9 | ||||
-rw-r--r-- | examples/c/ex_test_perf.c | 2 | ||||
-rw-r--r-- | src/btree/bt_stat.c | 5 | ||||
-rw-r--r-- | src/config/config_def.c | 4 | ||||
-rw-r--r-- | src/conn/conn_stat.c | 3 | ||||
-rw-r--r-- | src/cursor/cur_stat.c | 39 | ||||
-rw-r--r-- | src/include/extern.h | 11 | ||||
-rw-r--r-- | src/include/stat.h | 13 | ||||
-rw-r--r-- | src/include/wiredtiger.in | 27 | ||||
-rw-r--r-- | src/lsm/lsm_stat.c | 98 | ||||
-rw-r--r-- | src/lsm/lsm_worker.c | 13 | ||||
-rw-r--r-- | src/support/stat.c | 19 |
14 files changed, 217 insertions, 36 deletions
diff --git a/dist/api_data.py b/dist/api_data.py index 72dbfbeb860..954180f3a2f 100644 --- a/dist/api_data.py +++ b/dist/api_data.py @@ -329,6 +329,10 @@ methods = { reset statistics counters when the cursor is closed; valid only for statistics cursors''', type='boolean'), + Config('statistics_fast', 'false', r''' + only gather statistics that don't require traversing the tree; + valid only for statistics cursors''', + type='boolean'), Config('target', '', r''' if non-empty, backup the list of objects; valid only for a backup data source''', diff --git a/dist/s_string.ok b/dist/s_string.ok index 4ed1f29ff01..7444e386bef 100644 --- a/dist/s_string.ok +++ b/dist/s_string.ok @@ -33,6 +33,7 @@ Bsearch Btree Bzip CAS +CDLMRSTdehikrsuv CELL's CELLs CKPT @@ -163,6 +164,7 @@ SCHED SIMD SLIST SLVG +SML SQL SSq STAILQ @@ -421,6 +423,7 @@ huffman hval iS iSh +icount ikey imref incr @@ -440,6 +443,7 @@ ints inuse io ispo +kb kcell keycmp keyname @@ -460,6 +464,7 @@ loadtext logput lookup lookups +lr lru lsm lsn @@ -629,6 +634,7 @@ sunique superset sys syserr +sz t's tV tablename diff --git a/dist/stat_data.py b/dist/stat_data.py index 99115d84a0c..2c436a38bf5 100644 --- a/dist/stat_data.py +++ b/dist/stat_data.py @@ -98,8 +98,17 @@ btree_stats = [ # LSM statistics ########################################## lsm_stats = [ + Stat('chunk_cache_read', 'Number of pages read into LSM chunks'), + Stat('chunk_cache_write', 'Number of pages written from chunks'), Stat('bloom_hits', 'Number of successful bloom filter lookups'), Stat('bloom_misses', 'Number of successful bloom filter false positives'), Stat('bloom_skips', 'Number of unsuccessful bloom filter lookups'), + Stat('bloom_space', 'Total space used by bloom filters'), + Stat('bloom_cache_read', 'Number of bloom pages read into cache'), + Stat('bloom_cache_write', 'Number of bloom pages written from cache'), + Stat('chunk_count', 'Number of chunks in the LSM tree'), + Stat('bloom_count', 'Number of bloom filters in the LSM tree'), + Stat('cache_read', 'Number of pages read into cache'), + Stat('cache_write', 'Number of pages written from cache'), ] diff --git a/examples/c/ex_test_perf.c b/examples/c/ex_test_perf.c index 05836ad214d..d53808fc984 100644 --- a/examples/c/ex_test_perf.c +++ b/examples/c/ex_test_perf.c @@ -577,7 +577,7 @@ void print_config(CONFIG *cfg) printf("\t %s\n", cfg->create ? "Creating" : "Using existing"); printf("\t Random seed: %d\n", cfg->rand_seed); if (cfg->create) - printf("\tInsert count: %d\n", cfg->icount); + printf("\t Insert count: %d\n", cfg->icount); printf("\t key size: %d data size: %d\n", cfg->key_sz, cfg->data_sz); printf("\t Reporting interval: %d\n", cfg->report_interval); printf("\t Read workload period: %d\n", cfg->read_time); diff --git a/src/btree/bt_stat.c b/src/btree/bt_stat.c index d1a587eab97..c9ea8c84869 100644 --- a/src/btree/bt_stat.c +++ b/src/btree/bt_stat.c @@ -16,7 +16,7 @@ static int __stat_page_row_leaf(WT_SESSION_IMPL *, WT_PAGE *); * Initialize the Btree statistics. */ int -__wt_btree_stat_init(WT_SESSION_IMPL *session) +__wt_btree_stat_init(WT_SESSION_IMPL *session, uint32_t flags) { WT_BTREE *btree; WT_DECL_RET; @@ -34,6 +34,9 @@ __wt_btree_stat_init(WT_SESSION_IMPL *session) WT_BSTAT_SET(session, file_maxleafitem, btree->maxleafitem); page = NULL; + if (LF_ISSET(WT_STATISTICS_FAST)) + return (0); + while ((ret = __wt_tree_walk(session, &page, 0)) == 0 && page != NULL) WT_RET(__stat_page(session, page)); return (ret == WT_NOTFOUND ? 0 : ret); diff --git a/src/config/config_def.c b/src/config/config_def.c index dfda90b1aa1..2b19994a76b 100644 --- a/src/config/config_def.c +++ b/src/config/config_def.c @@ -286,7 +286,8 @@ __wt_confchk_session_log_printf[] = { const char * __wt_confdfl_session_open_cursor = "append=0,bulk=0,checkpoint=,dump=,next_random=0,no_cache=0," - "overwrite=0,raw=0,statistics=0,statistics_clear=0,target="; + "overwrite=0,raw=0,statistics=0,statistics_clear=0,statistics_fast=0," + "target="; WT_CONFIG_CHECK __wt_confchk_session_open_cursor[] = { @@ -300,6 +301,7 @@ __wt_confchk_session_open_cursor[] = { { "raw", "boolean", NULL }, { "statistics", "boolean", NULL }, { "statistics_clear", "boolean", NULL }, + { "statistics_fast", "boolean", NULL }, { "target", "list", NULL }, { NULL, NULL, NULL } }; diff --git a/src/conn/conn_stat.c b/src/conn/conn_stat.c index 451803f4e5a..df861665b4b 100644 --- a/src/conn/conn_stat.c +++ b/src/conn/conn_stat.c @@ -12,10 +12,11 @@ * Initialize the per-connection statistics. */ void -__wt_conn_stat_init(WT_SESSION_IMPL *session) +__wt_conn_stat_init(WT_SESSION_IMPL *session, uint32_t flags) { WT_CONNECTION_IMPL *conn; + WT_UNUSED(flags); conn = S2C(session); __wt_cache_stats_update(conn); diff --git a/src/cursor/cur_stat.c b/src/cursor/cur_stat.c index 55095eea484..85107d7b525 100644 --- a/src/cursor/cur_stat.c +++ b/src/cursor/cur_stat.c @@ -302,16 +302,16 @@ __curstat_close(WT_CURSOR *cursor) */ static void __curstat_conn_init( - WT_SESSION_IMPL *session, WT_CURSOR_STAT *cst, int statistics_clear) + WT_SESSION_IMPL *session, WT_CURSOR_STAT *cst, uint32_t flags) { - __wt_conn_stat_init(session); + __wt_conn_stat_init(session, flags); cst->btree = NULL; cst->notpositioned = 1; cst->stats_first = (WT_STATS *)S2C(session)->stats; cst->stats_count = sizeof(WT_CONNECTION_STATS) / sizeof(WT_STATS); - cst->clear_func = - statistics_clear ? __wt_stat_clear_connection_stats : NULL; + cst->clear_func = LF_ISSET(WT_STATISTICS_CLEAR) ? + __wt_stat_clear_connection_stats : NULL; } /* @@ -320,19 +320,20 @@ __curstat_conn_init( */ static int __curstat_file_init(WT_SESSION_IMPL *session, - const char *uri, WT_CURSOR_STAT *cst, int statistics_clear) + const char *uri, const char *cfg[], WT_CURSOR_STAT *cst, uint32_t flags) { WT_BTREE *btree; - WT_RET(__wt_session_get_btree(session, uri, NULL, NULL, 0)); + WT_RET(__wt_session_get_btree_ckpt(session, uri, cfg, 0)); btree = session->btree; - WT_RET(__wt_btree_stat_init(session)); + WT_RET(__wt_btree_stat_init(session, flags)); cst->btree = btree; cst->notpositioned = 1; cst->stats_first = (WT_STATS *)session->btree->stats; cst->stats_count = sizeof(WT_BTREE_STATS) / sizeof(WT_STATS); - cst->clear_func = statistics_clear ? __wt_stat_clear_btree_stats : NULL; + cst->clear_func = LF_ISSET(WT_STATISTICS_CLEAR) ? + __wt_stat_clear_btree_stats : NULL; return (0); } @@ -342,19 +343,20 @@ __curstat_file_init(WT_SESSION_IMPL *session, */ static int __curstat_lsm_init(WT_SESSION_IMPL *session, - const char *uri, WT_CURSOR_STAT *cst, int statistics_clear) + const char *uri, WT_CURSOR_STAT *cst, uint32_t flags) { WT_LSM_TREE *lsm_tree; WT_RET(__wt_lsm_tree_get(session, uri, &lsm_tree)); - WT_RET(__wt_lsm_stat_init(session, lsm_tree)); + WT_RET(__wt_lsm_stat_init(session, lsm_tree, flags)); cst->btree = NULL; cst->notpositioned = 1; cst->stats_first = (WT_STATS *)lsm_tree->stats; cst->stats_count = sizeof(WT_LSM_STATS) / sizeof(WT_STATS); - cst->clear_func = statistics_clear ? __wt_stat_clear_lsm_stats : NULL; + cst->clear_func = LF_ISSET(WT_STATISTICS_CLEAR) ? + __wt_stat_clear_lsm_stats : NULL; return (0); } @@ -398,12 +400,17 @@ __wt_curstat_open(WT_SESSION_IMPL *session, WT_CURSOR *cursor; WT_CURSOR_STAT *cst; WT_DECL_RET; - int statistics_clear; + uint32_t flags; cst = NULL; + flags = 0; WT_RET(__wt_config_gets_defno(session, cfg, "statistics_clear", &cval)); - statistics_clear = (cval.val != 0); + if (cval.val != 0) + LF_SET(WT_STATISTICS_CLEAR); + WT_RET(__wt_config_gets_defno(session, cfg, "statistics_fast", &cval)); + if (cval.val != 0) + LF_SET(WT_STATISTICS_FAST); WT_ERR(__wt_calloc_def(session, 1, &cst)); cursor = &cst->iface; @@ -419,13 +426,13 @@ __wt_curstat_open(WT_SESSION_IMPL *session, cursor->value_format = "SSq"; if (strcmp(uri, "statistics:") == 0) - __curstat_conn_init(session, cst, statistics_clear); + __curstat_conn_init(session, cst, flags); else if (WT_PREFIX_MATCH(uri, "statistics:file:")) WT_ERR(__curstat_file_init(session, - uri + strlen("statistics:"), cst, statistics_clear)); + uri + strlen("statistics:"), cfg, cst, flags)); else if (WT_PREFIX_MATCH(uri, "statistics:lsm:")) WT_ERR(__curstat_lsm_init(session, - uri + strlen("statistics:"), cst, statistics_clear)); + uri + strlen("statistics:"), cst, flags)); else WT_ERR(__wt_bad_object_type(session, uri)); diff --git a/src/include/extern.h b/src/include/extern.h index 37aedf07589..04d4defef22 100644 --- a/src/include/extern.h +++ b/src/include/extern.h @@ -348,7 +348,7 @@ extern int __wt_kv_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt); extern int __wt_bt_salvage( WT_SESSION_IMPL *session, WT_CKPT *ckptbase, const char *cfg[]); -extern int __wt_btree_stat_init(WT_SESSION_IMPL *session); +extern int __wt_btree_stat_init(WT_SESSION_IMPL *session, uint32_t flags); extern int __wt_bt_cache_force_write(WT_SESSION_IMPL *session); extern int __wt_bt_cache_flush(WT_SESSION_IMPL *session, WT_CKPT *ckptbase, @@ -596,7 +596,7 @@ extern int __wt_connection_init(WT_CONNECTION_IMPL *conn); extern void __wt_connection_destroy(WT_CONNECTION_IMPL *conn); extern int __wt_connection_open(WT_CONNECTION_IMPL *conn, const char *cfg[]); extern int __wt_connection_close(WT_CONNECTION_IMPL *conn); -extern void __wt_conn_stat_init(WT_SESSION_IMPL *session); +extern void __wt_conn_stat_init(WT_SESSION_IMPL *session, uint32_t flags); extern int __wt_curbackup_open(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], @@ -689,7 +689,9 @@ extern int __wt_lsm_merge_update_tree(WT_SESSION_IMPL *session, extern int __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); extern int __wt_lsm_meta_read(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); extern int __wt_lsm_meta_write(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); -extern int __wt_lsm_stat_init(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree); +extern int __wt_lsm_stat_init( WT_SESSION_IMPL *session, + WT_LSM_TREE *lsm_tree, + uint32_t flags); extern int __wt_lsm_tree_close_all(WT_SESSION_IMPL *session); extern int __wt_lsm_tree_bloom_name( WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, @@ -730,6 +732,9 @@ extern int __wt_lsm_tree_worker(WT_SESSION_IMPL *session, uint32_t open_flags); extern void *__wt_lsm_worker(void *arg); extern void *__wt_lsm_checkpoint_worker(void *arg); +extern int __wt_lsm_copy_chunks(WT_SESSION_IMPL *session, + WT_LSM_TREE *lsm_tree, + WT_LSM_WORKER_COOKIE *cookie); extern int __wt_metadata_get(WT_SESSION *session, const char *uri, const char **valuep); diff --git a/src/include/stat.h b/src/include/stat.h index 291c62f8f34..a2656acd6ed 100644 --- a/src/include/stat.h +++ b/src/include/stat.h @@ -40,6 +40,10 @@ struct __wt_stats { #define WT_CSTAT_INCR(session, fld) \ WT_STAT_INCR(S2C(session)->stats, fld) +/* Flags used by statistics initialization. */ +#define WT_STATISTICS_CLEAR 0x01 +#define WT_STATISTICS_FAST 0x02 + /* * DO NOT EDIT: automatically built by dist/stat.py. */ @@ -129,9 +133,18 @@ struct __wt_connection_stats { * Statistics entries for LSM handle. */ struct __wt_lsm_stats { + WT_STATS bloom_count; + WT_STATS bloom_cache_read; + WT_STATS bloom_cache_write; + WT_STATS chunk_count; + WT_STATS chunk_cache_read; + WT_STATS cache_read; + WT_STATS cache_write; + WT_STATS chunk_cache_write; WT_STATS bloom_misses; WT_STATS bloom_hits; WT_STATS bloom_skips; + WT_STATS bloom_space; }; /* Statistics section: END */ diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in index c876c8a0da7..677d6cd09f3 100644 --- a/src/include/wiredtiger.in +++ b/src/include/wiredtiger.in @@ -552,6 +552,9 @@ struct __wt_session { * @config{statistics_clear, reset statistics counters when the cursor * is closed; valid only for statistics cursors.,a boolean flag; default * \c false.} + * @config{statistics_fast, only gather statistics that don't require + * traversing the tree; valid only for statistics cursors.,a boolean + * flag; default \c false.} * @config{target, if non-empty\, backup the list of objects; valid only * for a backup data source.,a list of strings; default empty.} * @configend @@ -1785,12 +1788,30 @@ extern int wiredtiger_extension_init(WT_SESSION *session, * @anchor statistics_lsm * @{ */ +/*! Number of bloom filters in the LSM tree */ +#define WT_STAT_bloom_count 0 +/*! Number of bloom pages read into cache */ +#define WT_STAT_bloom_cache_read 1 +/*! Number of bloom pages written from cache */ +#define WT_STAT_bloom_cache_write 2 +/*! Number of chunks in the LSM tree */ +#define WT_STAT_chunk_count 3 +/*! Number of pages read into LSM chunks */ +#define WT_STAT_chunk_cache_read 4 +/*! Number of pages read into cache */ +#define WT_STAT_cache_read 5 +/*! Number of pages written from cache */ +#define WT_STAT_cache_write 6 +/*! Number of pages written from chunks */ +#define WT_STAT_chunk_cache_write 7 /*! Number of successful bloom filter false positives */ -#define WT_STAT_bloom_misses 0 +#define WT_STAT_bloom_misses 8 /*! Number of successful bloom filter lookups */ -#define WT_STAT_bloom_hits 1 +#define WT_STAT_bloom_hits 9 /*! Number of unsuccessful bloom filter lookups */ -#define WT_STAT_bloom_skips 2 +#define WT_STAT_bloom_skips 10 +/*! Total space used by bloom filters */ +#define WT_STAT_bloom_space 11 /*! @} */ /* * Statistics section: END diff --git a/src/lsm/lsm_stat.c b/src/lsm/lsm_stat.c index 61de4d6bf9f..ea64441acdf 100644 --- a/src/lsm/lsm_stat.c +++ b/src/lsm/lsm_stat.c @@ -12,13 +12,105 @@ * Initialize a LSM statistics structure. */ int -__wt_lsm_stat_init(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) +__wt_lsm_stat_init( + WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, uint32_t flags) { - WT_UNUSED(session); - WT_UNUSED(lsm_tree); + WT_CURSOR *stat_cursor; + WT_DECL_RET; + WT_LSM_CHUNK *chunk; + WT_LSM_WORKER_COOKIE cookie; + const char *cfg[] = API_CONF_DEFAULTS( + session, open_cursor, "statistics_fast=on"); + const char *disk_cfg[] = API_CONF_DEFAULTS(session, + open_cursor, "checkpoint=WiredTigerCheckpoint,statistics_fast=on"); + const char *desc, *pvalue; + char *uri; + int i; + size_t alloc_len, uri_len; + uint64_t value; + + WT_UNUSED(flags); + alloc_len = 0; + uri = NULL; /* * TODO: Make a copy of the stat fields so the stat cursor gets a * consistent view? If so should the copy belong to the stat cursor? */ + /* Clear the statistics we are about to recalculate. */ + WT_STAT_SET(lsm_tree->stats, bloom_count, 0); + WT_STAT_SET(lsm_tree->stats, bloom_cache_read, 0); + WT_STAT_SET(lsm_tree->stats, chunk_cache_read, 0); + WT_STAT_SET(lsm_tree->stats, cache_read, 0); + WT_STAT_SET(lsm_tree->stats, cache_write, 0); + WT_STAT_SET(lsm_tree->stats, chunk_cache_write, 0); + WT_STAT_SET(lsm_tree->stats, bloom_space, 0); + + /* Grab a snapshot of the LSM tree chunks. */ + WT_CLEAR(cookie); + WT_ERR(__wt_lsm_copy_chunks(session, lsm_tree, &cookie)); + + /* Set the stats for this run. */ + WT_STAT_SET(lsm_tree->stats, chunk_count, cookie.nchunks); + for (i = 0; i < cookie.nchunks; i++) { + chunk = cookie.chunk_array[i]; + uri_len = strlen("statistics:") + strlen(chunk->uri) + 1; + if (uri_len > alloc_len) + WT_ERR(__wt_realloc( + session, &alloc_len, uri_len, &uri)); + snprintf(uri, alloc_len, "statistics:%s", chunk->uri); + /* + * LSM chunks reads happen from a checkpoint, so get the + * statistics for a checkpoint if one exists. + */ + WT_ERR(__wt_curstat_open(session, uri, + F_ISSET(chunk, WT_LSM_CHUNK_ONDISK) ? disk_cfg : cfg, + &stat_cursor)); + stat_cursor->set_key(stat_cursor, WT_STAT_page_read); + stat_cursor->search(stat_cursor); + WT_ERR(stat_cursor->get_value( + stat_cursor, &desc, &pvalue, &value)); + WT_STAT_INCRV(lsm_tree->stats, cache_read, value); + WT_STAT_INCRV(lsm_tree->stats, chunk_cache_read, value); + stat_cursor->set_key(stat_cursor, WT_STAT_page_write); + stat_cursor->search(stat_cursor); + WT_ERR(stat_cursor->get_value( + stat_cursor, &desc, &pvalue, &value)); + WT_STAT_INCRV(lsm_tree->stats, cache_write, value); + WT_STAT_INCRV(lsm_tree->stats, chunk_cache_write, value); + stat_cursor->close(stat_cursor); + + if (chunk->bloom_uri != NULL) { + WT_STAT_INCR(lsm_tree->stats, bloom_count); + WT_STAT_INCRV(lsm_tree->stats, bloom_space, + (chunk->count * lsm_tree->bloom_bit_count) / 8); + uri_len = strlen("statistics:") + + strlen(chunk->bloom_uri) + 1; + if (uri_len > alloc_len) + WT_ERR(__wt_realloc( + session, &alloc_len, uri_len, &uri)); + snprintf(uri, alloc_len, "statistics:%s", + chunk->bloom_uri); + WT_ERR(__wt_curstat_open(session, uri, + cfg, &stat_cursor)); + stat_cursor->set_key(stat_cursor, WT_STAT_page_read); + stat_cursor->search(stat_cursor); + WT_ERR(stat_cursor->get_value( + stat_cursor, &desc, &pvalue, &value)); + WT_STAT_INCRV(lsm_tree->stats, cache_read, value); + WT_STAT_INCRV(lsm_tree->stats, + bloom_cache_read, value); + stat_cursor->set_key(stat_cursor, WT_STAT_page_write); + stat_cursor->search(stat_cursor); + WT_ERR(stat_cursor->get_value( + stat_cursor, &desc, &pvalue, &value)); + WT_STAT_INCRV(lsm_tree->stats, cache_write, value); + WT_STAT_INCRV(lsm_tree->stats, + bloom_cache_write, value); + stat_cursor->close(stat_cursor); + } + } +err: __wt_free(session, cookie.chunk_array); + __wt_free(session, uri); + return (0); } diff --git a/src/lsm/lsm_worker.c b/src/lsm/lsm_worker.c index 545b941d7ce..f50841c5189 100644 --- a/src/lsm/lsm_worker.c +++ b/src/lsm/lsm_worker.c @@ -8,8 +8,6 @@ #include "wt_internal.h" static int __lsm_free_chunks(WT_SESSION_IMPL *, WT_LSM_TREE *); -static int __lsm_copy_chunks( - WT_SESSION_IMPL *, WT_LSM_TREE *, WT_LSM_WORKER_COOKIE *); /* * __wt_lsm_worker -- @@ -71,7 +69,7 @@ __wt_lsm_checkpoint_worker(void *arg) WT_CLEAR(cookie); while (F_ISSET(lsm_tree, WT_LSM_TREE_WORKING)) { - WT_ERR(__lsm_copy_chunks(session, lsm_tree, &cookie)); + WT_ERR(__wt_lsm_copy_chunks(session, lsm_tree, &cookie)); /* Write checkpoints in all completed files. */ for (i = 0, j = 0; i < cookie.nchunks; i++) { @@ -108,11 +106,12 @@ err: __wt_free(session, cookie.chunk_array); } /* - * Take a copy of part of the LSM tree chunk array so that we can work on - * the contents without holding the LSM tree handle lock long term. + * __wt_lsm_copy_chunks -- + * Take a copy of part of the LSM tree chunk array so that we can work on + * the contents without holding the LSM tree handle lock long term. */ -static int -__lsm_copy_chunks(WT_SESSION_IMPL *session, +int +__wt_lsm_copy_chunks(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, WT_LSM_WORKER_COOKIE *cookie) { WT_DECL_RET; diff --git a/src/support/stat.c b/src/support/stat.c index 426e0ef7104..7cc5b33ff71 100644 --- a/src/support/stat.c +++ b/src/support/stat.c @@ -190,11 +190,21 @@ __wt_stat_alloc_lsm_stats(WT_SESSION_IMPL *session, WT_LSM_STATS **statsp) WT_RET(__wt_calloc_def(session, 1, &stats)); + stats->bloom_cache_read.desc = "Number of bloom pages read into cache"; + stats->bloom_cache_write.desc = + "Number of bloom pages written from cache"; + stats->bloom_count.desc = "Number of bloom filters in the LSM tree"; stats->bloom_hits.desc = "Number of successful bloom filter lookups"; stats->bloom_misses.desc = "Number of successful bloom filter false positives"; stats->bloom_skips.desc = "Number of unsuccessful bloom filter lookups"; + stats->bloom_space.desc = "Total space used by bloom filters"; + stats->cache_read.desc = "Number of pages read into cache"; + stats->cache_write.desc = "Number of pages written from cache"; + stats->chunk_cache_read.desc = "Number of pages read into LSM chunks"; + stats->chunk_cache_write.desc = "Number of pages written from chunks"; + stats->chunk_count.desc = "Number of chunks in the LSM tree"; *statsp = stats; return (0); @@ -206,7 +216,16 @@ __wt_stat_clear_lsm_stats(WT_STATS *stats_arg) WT_LSM_STATS *stats; stats = (WT_LSM_STATS *)stats_arg; + stats->bloom_cache_read.v = 0; + stats->bloom_cache_write.v = 0; + stats->bloom_count.v = 0; stats->bloom_hits.v = 0; stats->bloom_misses.v = 0; stats->bloom_skips.v = 0; + stats->bloom_space.v = 0; + stats->cache_read.v = 0; + stats->cache_write.v = 0; + stats->chunk_cache_read.v = 0; + stats->chunk_cache_write.v = 0; + stats->chunk_count.v = 0; } |