diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2017-10-18 21:18:06 -0400 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2017-10-19 12:18:06 +1100 |
commit | 7d777c7bafad5312b7c6b55b9fa3c56991d08b12 (patch) | |
tree | 45659bbdbbbafa9232ae6da965c1ce041f4e83cf | |
parent | d2a159bb752efdf1c63c42b8e9d00b57f2797c45 (diff) | |
download | mongo-7d777c7bafad5312b7c6b55b9fa3c56991d08b12.tar.gz |
WT-3640 Change bytes-read statistic (#3714)
Reads should include overflow pages and reads shouldn't include allocated memory chunks associated with the page (for example, WT_REF arrays), writes should be updated atomically.
-rw-r--r-- | src/btree/bt_io.c | 5 | ||||
-rw-r--r-- | src/btree/bt_page.c | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/btree/bt_io.c b/src/btree/bt_io.c index 6d2e69d7f9b..e443fbdc94b 100644 --- a/src/btree/bt_io.c +++ b/src/btree/bt_io.c @@ -145,6 +145,8 @@ __wt_bt_read(WT_SESSION_IMPL *session, WT_STAT_DATA_INCR(session, compress_read); WT_STAT_CONN_INCRV(session, cache_bytes_read, dsk->mem_size); WT_STAT_DATA_INCRV(session, cache_bytes_read, dsk->mem_size); + (void)__wt_atomic_add64( + &S2C(session)->cache->bytes_read, dsk->mem_size); if (0) { corrupt: if (ret == 0) @@ -382,9 +384,10 @@ __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf, WT_STAT_CONN_INCR(session, cache_write); WT_STAT_DATA_INCR(session, cache_write); - S2C(session)->cache->bytes_written += dsk->mem_size; WT_STAT_CONN_INCRV(session, cache_bytes_write, dsk->mem_size); WT_STAT_DATA_INCRV(session, cache_bytes_write, dsk->mem_size); + (void)__wt_atomic_add64( + &S2C(session)->cache->bytes_written, dsk->mem_size); err: __wt_scr_free(session, &ctmp); __wt_scr_free(session, &etmp); diff --git a/src/btree/bt_page.c b/src/btree/bt_page.c index d3df9f6bf78..68b242bf91e 100644 --- a/src/btree/bt_page.c +++ b/src/btree/bt_page.c @@ -114,7 +114,6 @@ err: if ((pindex = WT_INTL_INDEX_GET_SAFE(page)) != NULL) { /* Increment the cache statistics. */ __wt_cache_page_inmem_incr(session, page, size); - (void)__wt_atomic_add64(&cache->bytes_read, size); (void)__wt_atomic_add64(&cache->pages_inmem, 1); page->cache_create_gen = cache->evict_pass_gen; |