diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2015-03-11 07:09:18 +0000 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2015-03-11 07:09:18 +0000 |
commit | e28d6c993cefbb66f5e84a37bc4cfff4ace05239 (patch) | |
tree | 3ee59ba870d3ef279860bad796e331e4a30f1f9e /src/include | |
parent | 7ee20176acc77aef2c74eec2e4259b9929fb6dc5 (diff) | |
download | mongo-e28d6c993cefbb66f5e84a37bc4cfff4ace05239.tar.gz |
Add some statistics and update places that call txn_visible_all
to use txn_visible_checkpoint.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/stat.h | 2 | ||||
-rw-r--r-- | src/include/txn.i | 13 | ||||
-rw-r--r-- | src/include/wiredtiger.in | 12 |
3 files changed, 20 insertions, 7 deletions
diff --git a/src/include/stat.h b/src/include/stat.h index 24c1ca21f4a..39f26bae37b 100644 --- a/src/include/stat.h +++ b/src/include/stat.h @@ -268,8 +268,10 @@ struct __wt_connection_stats { WT_STATS txn_checkpoint_time_total; WT_STATS txn_commit; WT_STATS txn_fail_cache; + WT_STATS txn_not_visible_checkpoint; WT_STATS txn_pinned_range; WT_STATS txn_rollback; + WT_STATS txn_visible_checkpoint; WT_STATS write_io; }; diff --git a/src/include/txn.i b/src/include/txn.i index df22145f79a..dd197c08142 100644 --- a/src/include/txn.i +++ b/src/include/txn.i @@ -112,7 +112,7 @@ static inline int __wt_txn_visible_checkpoint(WT_SESSION_IMPL *session, uint64_t id) { WT_TXN_GLOBAL *txn_global; - uint64_t checkpoint_id; + uint64_t checkpoint_id, oldest_id; txn_global = &S2C(session)->txn_global; @@ -136,9 +136,14 @@ __wt_txn_visible_checkpoint(WT_SESSION_IMPL *session, uint64_t id) * If the checkpoint ID is the oldest ID in the system - use it for the * visibility check. Otherwise use the tracked oldest ID. */ - return (TXNID_LT(id, - TXNID_LT(txn_global->oldest_id, checkpoint_id) ? - txn_global->oldest_id : checkpoint_id)); + if (TXNID_LT(txn_global->oldest_id, checkpoint_id)) { + oldest_id = txn_global->oldest_id; + WT_STAT_FAST_CONN_INCR(session, txn_visible_checkpoint); + } else { + oldest_id = checkpoint_id; + WT_STAT_FAST_CONN_INCR(session, txn_not_visible_checkpoint); + } + return oldest_id; } /* diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in index ac3907da217..cadae33ee5b 100644 --- a/src/include/wiredtiger.in +++ b/src/include/wiredtiger.in @@ -3441,12 +3441,18 @@ extern int wiredtiger_extension_terminate(WT_CONNECTION *connection); #define WT_STAT_CONN_TXN_COMMIT 1134 /*! transaction: transaction failures due to cache overflow */ #define WT_STAT_CONN_TXN_FAIL_CACHE 1135 +/*! transaction: Transaction visibility checks where checkpoint ID was not + * used */ +#define WT_STAT_CONN_TXN_NOT_VISIBLE_CHECKPOINT 1136 /*! transaction: transaction range of IDs currently pinned */ -#define WT_STAT_CONN_TXN_PINNED_RANGE 1136 +#define WT_STAT_CONN_TXN_PINNED_RANGE 1137 /*! transaction: transactions rolled back */ -#define WT_STAT_CONN_TXN_ROLLBACK 1137 +#define WT_STAT_CONN_TXN_ROLLBACK 1138 +/*! transaction: Transaction visibility checks where checkpoint ID was + * used */ +#define WT_STAT_CONN_TXN_VISIBLE_CHECKPOINT 1139 /*! connection: total write I/Os */ -#define WT_STAT_CONN_WRITE_IO 1138 +#define WT_STAT_CONN_WRITE_IO 1140 /*! * @} |