diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/support/modify.c')
-rw-r--r-- | src/third_party/wiredtiger/src/support/modify.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/src/support/modify.c b/src/third_party/wiredtiger/src/support/modify.c index 15f8a33772f..be1b1970da6 100644 --- a/src/third_party/wiredtiger/src/support/modify.c +++ b/src/third_party/wiredtiger/src/support/modify.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2018 MongoDB, Inc. + * Copyright (c) 2014-2019 MongoDB, Inc. * Copyright (c) 2008-2014 WiredTiger, Inc. * All rights reserved. * @@ -182,11 +182,30 @@ __wt_modify_apply_api(WT_SESSION_IMPL *session, WT_CURSOR *cursor, WT_MODIFY *entries, int nentries) WT_GCC_FUNC_ATTRIBUTE((visibility("default"))) { + size_t modified; int i; - for (i = 0; i < nentries; ++i) + for (modified = 0, i = 0; i < nentries; ++i) { + modified += entries[i].size; WT_RET(__modify_apply_one(session, cursor, entries[i].data.size, entries[i].offset, entries[i].size, entries[i].data.data)); + } + /* + * This API is used by some external test functions with a NULL + * session pointer - they don't expect statistics to be incremented. + */ + if (session != NULL) { + WT_STAT_CONN_INCR(session, cursor_modify); + WT_STAT_DATA_INCR(session, cursor_modify); + WT_STAT_CONN_INCRV(session, + cursor_modify_bytes, cursor->value.size); + WT_STAT_DATA_INCRV(session, + cursor_modify_bytes, cursor->value.size); + WT_STAT_CONN_INCRV(session, + cursor_modify_bytes_touch, modified); + WT_STAT_DATA_INCRV(session, + cursor_modify_bytes_touch, modified); + } return (0); } |