diff options
author | Sulabh Mahajan <sulabh.mahajan@mongodb.com> | 2016-09-14 13:20:11 +1000 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-09-14 13:20:11 +1000 |
commit | e189aa8a3de76fcd71a4dea254a24f02c80dfa19 (patch) | |
tree | 95ac2381de6c51b15ffa85e203be605e65b3ed72 /src/lsm | |
parent | 71c8bd736c888228d42d9a2ee478380d2224c984 (diff) | |
download | mongo-e189aa8a3de76fcd71a4dea254a24f02c80dfa19.tar.gz |
WT-2859 Restructure statistics gathering macros (#3016)
Having _FAST_ macros gives an impression that when we use them,
we are collecting fast statistics only, which is not true.
Except when statistics=none is set, we collect all the stats.
This change removes _FAST_ macros and modifies the basic macros
to only collect stats when statistics=none is not set.
Diffstat (limited to 'src/lsm')
-rw-r--r-- | src/lsm/lsm_cursor.c | 4 | ||||
-rw-r--r-- | src/lsm/lsm_manager.c | 14 | ||||
-rw-r--r-- | src/lsm/lsm_merge.c | 4 | ||||
-rw-r--r-- | src/lsm/lsm_stat.c | 28 |
4 files changed, 26 insertions, 24 deletions
diff --git a/src/lsm/lsm_cursor.c b/src/lsm/lsm_cursor.c index bf591d8dbe6..e8e54ada47d 100644 --- a/src/lsm/lsm_cursor.c +++ b/src/lsm/lsm_cursor.c @@ -1348,11 +1348,11 @@ __clsm_put(WT_SESSION_IMPL *session, WT_CURSOR_LSM *clsm, clsm->update_count = 0; WT_LSM_TREE_STAT_INCRV(session, lsm_tree->lsm_checkpoint_throttle, lsm_tree->ckpt_throttle); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCRV(session, lsm_checkpoint_throttle, lsm_tree->ckpt_throttle); WT_LSM_TREE_STAT_INCRV(session, lsm_tree->lsm_merge_throttle, lsm_tree->merge_throttle); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCRV(session, lsm_merge_throttle, lsm_tree->merge_throttle); __wt_sleep(0, lsm_tree->ckpt_throttle + lsm_tree->merge_throttle); diff --git a/src/lsm/lsm_manager.c b/src/lsm/lsm_manager.c index a504acc361c..5a5140b9c3a 100644 --- a/src/lsm/lsm_manager.c +++ b/src/lsm/lsm_manager.c @@ -328,7 +328,7 @@ __wt_lsm_manager_destroy(WT_SESSION_IMPL *session) WT_TRET(wt_session->close(wt_session, NULL)); } } - WT_STAT_FAST_CONN_INCRV(session, lsm_work_units_discarded, removed); + WT_STAT_CONN_INCRV(session, lsm_work_units_discarded, removed); /* Free resources that are allocated in connection initialize */ __wt_spin_destroy(session, &manager->switch_lock); @@ -413,7 +413,7 @@ __lsm_manager_run_server(WT_SESSION_IMPL *session) * more. */ if (lsm_tree->queue_ref >= LSM_TREE_MAX_QUEUE) - WT_STAT_FAST_CONN_INCR(session, + WT_STAT_CONN_INCR(session, lsm_work_queue_max); else if ((!lsm_tree->modified && lsm_tree->nchunks > 1) || @@ -539,7 +539,7 @@ __wt_lsm_manager_clear_tree(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) __wt_lsm_manager_free_work_unit(session, current); } __wt_spin_unlock(session, &manager->manager_lock); - WT_STAT_FAST_CONN_INCRV(session, lsm_work_units_discarded, removed); + WT_STAT_CONN_INCRV(session, lsm_work_units_discarded, removed); } /* @@ -554,7 +554,7 @@ __wt_lsm_manager_clear_tree(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) TAILQ_FOREACH(entry, (qh), q) { \ if (FLD_ISSET(type, entry->type)) { \ TAILQ_REMOVE(qh, entry, q); \ - WT_STAT_FAST_CONN_DECR(session, qlen); \ + WT_STAT_CONN_DECR(session, qlen); \ break; \ } \ } \ @@ -590,7 +590,7 @@ __wt_lsm_manager_pop_entry( LSM_POP_ENTRY(&manager->appqh, &manager->app_lock, lsm_work_queue_app); if (entry != NULL) - WT_STAT_FAST_CONN_INCR(session, lsm_work_units_done); + WT_STAT_CONN_INCR(session, lsm_work_units_done); *entryp = entry; return (0); } @@ -603,7 +603,7 @@ __wt_lsm_manager_pop_entry( #define LSM_PUSH_ENTRY(qh, qlock, qlen) do { \ __wt_spin_lock(session, qlock); \ TAILQ_INSERT_TAIL((qh), entry, q); \ - WT_STAT_FAST_CONN_INCR(session, qlen); \ + WT_STAT_CONN_INCR(session, qlen); \ __wt_spin_unlock(session, qlock); \ } while (0) @@ -656,7 +656,7 @@ __wt_lsm_manager_push_entry(WT_SESSION_IMPL *session, entry->type = type; entry->flags = flags; entry->lsm_tree = lsm_tree; - WT_STAT_FAST_CONN_INCR(session, lsm_work_units_created); + WT_STAT_CONN_INCR(session, lsm_work_units_created); if (type == WT_LSM_WORK_SWITCH) LSM_PUSH_ENTRY(&manager->switchqh, diff --git a/src/lsm/lsm_merge.c b/src/lsm/lsm_merge.c index 2276631af1e..4bbfcfd4411 100644 --- a/src/lsm/lsm_merge.c +++ b/src/lsm/lsm_merge.c @@ -461,7 +461,7 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id) if (!lsm_tree->active) WT_ERR(EINTR); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCRV(session, lsm_rows_merged, LSM_MERGE_CHECK_INTERVAL); ++lsm_tree->merge_progressing; } @@ -476,7 +476,7 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id) } WT_ERR_NOTFOUND_OK(ret); - WT_STAT_FAST_CONN_INCRV(session, + WT_STAT_CONN_INCRV(session, lsm_rows_merged, insert_count % LSM_MERGE_CHECK_INTERVAL); ++lsm_tree->merge_progressing; __wt_verbose(session, WT_VERB_LSM, diff --git a/src/lsm/lsm_stat.c b/src/lsm/lsm_stat.c index 95909ce30e8..f4f5a0acce8 100644 --- a/src/lsm/lsm_stat.c +++ b/src/lsm/lsm_stat.c @@ -39,7 +39,7 @@ __curstat_lsm_init( WT_ERR(__wt_scr_alloc(session, 0, &uribuf)); /* Propagate all, fast and/or clear to the cursors we open. */ - if (!F_ISSET(cst, WT_CONN_STAT_NONE)) { + if (cst->flags != 0) { (void)snprintf(config, sizeof(config), "statistics=(%s%s%s%s)", F_ISSET(cst, WT_CONN_STAT_ALL) ? "all," : "", @@ -91,7 +91,8 @@ __curstat_lsm_init( * top-level. */ new = (WT_DSRC_STATS *)WT_CURSOR_STATS(stat_cursor); - WT_STAT_WRITE(new, lsm_generation_max, chunk->generation); + WT_STAT_WRITE(session, + new, lsm_generation_max, chunk->generation); /* Aggregate statistics from each new chunk. */ __wt_stat_dsrc_aggregate_single(new, stats); @@ -115,40 +116,41 @@ __curstat_lsm_init( * into the top-level. */ new = (WT_DSRC_STATS *)WT_CURSOR_STATS(stat_cursor); - WT_STAT_WRITE(new, bloom_size, + WT_STAT_WRITE(session, new, bloom_size, (int64_t)((chunk->count * lsm_tree->bloom_bit_count) / 8)); - WT_STAT_WRITE(new, bloom_page_evict, + WT_STAT_WRITE(session, new, bloom_page_evict, new->cache_eviction_clean + new->cache_eviction_dirty); - WT_STAT_WRITE(new, bloom_page_read, new->cache_read); + WT_STAT_WRITE(session, new, bloom_page_read, new->cache_read); __wt_stat_dsrc_aggregate_single(new, stats); WT_ERR(stat_cursor->close(stat_cursor)); } /* Set statistics that aren't aggregated directly into the cursor */ - WT_STAT_WRITE(stats, bloom_count, bloom_count); - WT_STAT_WRITE(stats, lsm_chunk_count, lsm_tree->nchunks); + WT_STAT_WRITE(session, stats, bloom_count, bloom_count); + WT_STAT_WRITE(session, stats, lsm_chunk_count, lsm_tree->nchunks); /* Include, and optionally clear, LSM-level specific information. */ - WT_STAT_WRITE(stats, bloom_miss, lsm_tree->bloom_miss); + WT_STAT_WRITE(session, stats, bloom_miss, lsm_tree->bloom_miss); if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) lsm_tree->bloom_miss = 0; - WT_STAT_WRITE(stats, bloom_hit, lsm_tree->bloom_hit); + WT_STAT_WRITE(session, stats, bloom_hit, lsm_tree->bloom_hit); if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) lsm_tree->bloom_hit = 0; - WT_STAT_WRITE( + WT_STAT_WRITE(session, stats, bloom_false_positive, lsm_tree->bloom_false_positive); if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) lsm_tree->bloom_false_positive = 0; - WT_STAT_WRITE( + WT_STAT_WRITE(session, stats, lsm_lookup_no_bloom, lsm_tree->lsm_lookup_no_bloom); if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) lsm_tree->lsm_lookup_no_bloom = 0; - WT_STAT_WRITE( + WT_STAT_WRITE(session, stats, lsm_checkpoint_throttle, lsm_tree->lsm_checkpoint_throttle); if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) lsm_tree->lsm_checkpoint_throttle = 0; - WT_STAT_WRITE(stats, lsm_merge_throttle, lsm_tree->lsm_merge_throttle); + WT_STAT_WRITE(session, + stats, lsm_merge_throttle, lsm_tree->lsm_merge_throttle); if (F_ISSET(cst, WT_CONN_STAT_CLEAR)) lsm_tree->lsm_merge_throttle = 0; |