summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/block/block_open.c16
-rw-r--r--src/btree/bt_stat.c4
-rw-r--r--src/cache/cache_las.c9
-rw-r--r--src/include/stat.h4
-rw-r--r--src/lsm/lsm_stat.c31
5 files changed, 35 insertions, 29 deletions
diff --git a/src/block/block_open.c b/src/block/block_open.c
index 7cf12d36066..df021f924d9 100644
--- a/src/block/block_open.c
+++ b/src/block/block_open.c
@@ -405,13 +405,15 @@ __wt_block_stat(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_DSRC_STATS *stats)
* Reading from the live system's structure normally requires locking,
* but it's an 8B statistics read, there's no need.
*/
- stats->allocation_size = block->allocsize;
- stats->block_checkpoint_size = (int64_t)block->live.ckpt_size;
- stats->block_magic = WT_BLOCK_MAGIC;
- stats->block_major = WT_BLOCK_MAJOR_VERSION;
- stats->block_minor = WT_BLOCK_MINOR_VERSION;
- stats->block_reuse_bytes = (int64_t)block->live.avail.bytes;
- stats->block_size = block->fh->size;
+ WT_STAT_WRITE(stats, allocation_size, block->allocsize);
+ WT_STAT_WRITE(
+ stats, block_checkpoint_size, (int64_t)block->live.ckpt_size);
+ WT_STAT_WRITE(stats, block_magic, WT_BLOCK_MAGIC);
+ WT_STAT_WRITE(stats, block_major, WT_BLOCK_MAJOR_VERSION);
+ WT_STAT_WRITE(stats, block_minor, WT_BLOCK_MINOR_VERSION);
+ WT_STAT_WRITE(
+ stats, block_reuse_bytes, (int64_t)block->live.avail.bytes);
+ WT_STAT_WRITE(stats, block_size, block->fh->size);
}
/*
diff --git a/src/btree/bt_stat.c b/src/btree/bt_stat.c
index 2f8759b9d82..2c06ac2dc88 100644
--- a/src/btree/bt_stat.c
+++ b/src/btree/bt_stat.c
@@ -35,10 +35,10 @@ __wt_btree_stat_init(WT_SESSION_IMPL *session, WT_CURSOR_STAT *cst)
WT_STAT_SET(session, stats, btree_fixed_len, btree->bitcnt);
WT_STAT_SET(session, stats, btree_maximum_depth, btree->maximum_depth);
- WT_STAT_SET(session, stats, btree_maxintlpage, btree->maxintlpage);
WT_STAT_SET(session, stats, btree_maxintlkey, btree->maxintlkey);
- WT_STAT_SET(session, stats, btree_maxleafpage, btree->maxleafpage);
+ WT_STAT_SET(session, stats, btree_maxintlpage, btree->maxintlpage);
WT_STAT_SET(session, stats, btree_maxleafkey, btree->maxleafkey);
+ WT_STAT_SET(session, stats, btree_maxleafpage, btree->maxleafpage);
WT_STAT_SET(session, stats, btree_maxleafvalue, btree->maxleafvalue);
/* Everything else is really, really expensive. */
diff --git a/src/cache/cache_las.c b/src/cache/cache_las.c
index d3a0265c13a..e943f01236e 100644
--- a/src/cache/cache_las.c
+++ b/src/cache/cache_las.c
@@ -18,6 +18,7 @@ __wt_las_stats_update(WT_SESSION_IMPL *session)
WT_CONNECTION_IMPL *conn;
WT_CONNECTION_STATS **cstats;
WT_DSRC_STATS **dstats;
+ int64_t v;
conn = S2C(session);
@@ -37,10 +38,10 @@ __wt_las_stats_update(WT_SESSION_IMPL *session)
dstats = ((WT_CURSOR_BTREE *)
conn->las_session->las_cursor)->btree->dhandle->stats;
- WT_STAT_SET(session, cstats,
- cache_lookaside_insert, WT_STAT_READ(dstats, cursor_insert));
- WT_STAT_SET(session, cstats,
- cache_lookaside_remove, WT_STAT_READ(dstats, cursor_remove));
+ v = WT_STAT_READ(dstats, cursor_insert);
+ WT_STAT_SET(session, cstats, cache_lookaside_insert, v);
+ v = WT_STAT_READ(dstats, cursor_remove);
+ WT_STAT_SET(session, cstats, cache_lookaside_remove, v);
}
/*
diff --git a/src/include/stat.h b/src/include/stat.h
index dfe7ee5c6cd..a554607b7d5 100644
--- a/src/include/stat.h
+++ b/src/include/stat.h
@@ -139,8 +139,8 @@ __wt_stats_clear(void *stats_arg, int slot)
*/
#define WT_STAT_READ(stats, fld) \
__wt_stats_aggregate(stats, WT_STATS_FIELD_TO_SLOT(stats, fld))
-#define WT_STAT_WRITE(session, stats, fld) \
- ((stats)[WT_STATS_SLOT_ID(session)]->fld);
+#define WT_STAT_WRITE(stats, fld, v) \
+ (stats)->fld = (int64_t)(v)
#define WT_STAT_DECRV(session, stats, fld, value) \
(stats)[WT_STATS_SLOT_ID(session)]->fld -= (int64_t)(value)
diff --git a/src/lsm/lsm_stat.c b/src/lsm/lsm_stat.c
index c1eb7a2a389..7c53990a2a2 100644
--- a/src/lsm/lsm_stat.c
+++ b/src/lsm/lsm_stat.c
@@ -91,7 +91,7 @@ __curstat_lsm_init(
* top-level.
*/
new = (WT_DSRC_STATS *)WT_CURSOR_STATS(stat_cursor);
- new->lsm_generation_max = chunk->generation;
+ WT_STAT_WRITE(new, lsm_generation_max, chunk->generation);
/* Aggregate statistics from each new chunk. */
__wt_stat_dsrc_aggregate_single(new, stats);
@@ -115,37 +115,40 @@ __curstat_lsm_init(
* into the top-level.
*/
new = (WT_DSRC_STATS *)WT_CURSOR_STATS(stat_cursor);
- new->bloom_size =
- (int64_t)((chunk->count * lsm_tree->bloom_bit_count) / 8);
- new->bloom_page_evict =
- new->cache_eviction_clean + new->cache_eviction_dirty;
- new->bloom_page_read = new->cache_read;
+ WT_STAT_WRITE(new, bloom_size,
+ (int64_t)((chunk->count * lsm_tree->bloom_bit_count) / 8));
+ WT_STAT_WRITE(new, bloom_page_evict,
+ new->cache_eviction_clean + new->cache_eviction_dirty);
+ WT_STAT_WRITE(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 */
- stats->bloom_count = bloom_count;
- stats->lsm_chunk_count = lsm_tree->nchunks;
+ WT_STAT_WRITE(stats, bloom_count, bloom_count);
+ WT_STAT_WRITE(stats, lsm_chunk_count, lsm_tree->nchunks);
/* Include, and optionally clear, LSM-level specific information. */
- stats->bloom_miss = lsm_tree->bloom_miss;
+ WT_STAT_WRITE(stats, bloom_miss, lsm_tree->bloom_miss);
if (F_ISSET(cst, WT_CONN_STAT_CLEAR))
lsm_tree->bloom_miss = 0;
- stats->bloom_hit = lsm_tree->bloom_hit;
+ WT_STAT_WRITE(stats, bloom_hit, lsm_tree->bloom_hit);
if (F_ISSET(cst, WT_CONN_STAT_CLEAR))
lsm_tree->bloom_hit = 0;
- stats->bloom_false_positive = lsm_tree->bloom_false_positive;
+ WT_STAT_WRITE(
+ stats, bloom_false_positive, lsm_tree->bloom_false_positive);
if (F_ISSET(cst, WT_CONN_STAT_CLEAR))
lsm_tree->bloom_false_positive = 0;
- stats->lsm_lookup_no_bloom = lsm_tree->lsm_lookup_no_bloom;
+ WT_STAT_WRITE(
+ 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;
- stats->lsm_checkpoint_throttle = lsm_tree->lsm_checkpoint_throttle;
+ WT_STAT_WRITE(
+ stats, lsm_checkpoint_throttle, lsm_tree->lsm_checkpoint_throttle);
if (F_ISSET(cst, WT_CONN_STAT_CLEAR))
lsm_tree->lsm_checkpoint_throttle = 0;
- stats->lsm_merge_throttle = lsm_tree->lsm_merge_throttle;
+ WT_STAT_WRITE(stats, lsm_merge_throttle, lsm_tree->lsm_merge_throttle);
if (F_ISSET(cst, WT_CONN_STAT_CLEAR))
lsm_tree->lsm_merge_throttle = 0;