summaryrefslogtreecommitdiff
path: root/src/btree/bt_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/btree/bt_io.c')
-rw-r--r--src/btree/bt_io.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/btree/bt_io.c b/src/btree/bt_io.c
index 42c3a849a88..a8645f79dbe 100644
--- a/src/btree/bt_io.c
+++ b/src/btree/bt_io.c
@@ -171,6 +171,7 @@ __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf,
uint8_t *addr, size_t *addr_sizep,
bool checkpoint, bool checkpoint_io, bool compressed)
{
+ struct timespec start, stop;
WT_BM *bm;
WT_BTREE *btree;
WT_DECL_ITEM(ctmp);
@@ -356,6 +357,8 @@ __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf,
data_checksum = !compressed;
break;
}
+ if (!F_ISSET(session, WT_SESSION_INTERNAL))
+ __wt_epoch(session, &start);
/* Call the block manager to write the block. */
WT_ERR(checkpoint ?
@@ -363,6 +366,14 @@ __wt_bt_write(WT_SESSION_IMPL *session, WT_ITEM *buf,
bm->write(
bm, session, ip, addr, addr_sizep, data_checksum, checkpoint_io));
+ /* Update some statistics now that the write is done */
+ if (!F_ISSET(session, WT_SESSION_INTERNAL)) {
+ __wt_epoch(session, &stop);
+ WT_STAT_CONN_INCR(session, cache_write_app_count);
+ WT_STAT_CONN_INCRV(session, cache_write_app_time,
+ WT_TIMEDIFF_US(stop, start));
+ }
+
WT_STAT_CONN_INCR(session, cache_write);
WT_STAT_DATA_INCR(session, cache_write);
S2C(session)->cache->bytes_written += dsk->mem_size;