summaryrefslogtreecommitdiff
path: root/src/txn
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-11-12 16:24:26 -0500
committerKeith Bostic <keith@wiredtiger.com>2014-11-12 16:24:26 -0500
commit1e9edd51844e5e4fd88a37be53d9331642938c95 (patch)
tree9e7acfff7f7832fe53ac0868a8cf57c74c477434 /src/txn
parenta917e5b7177d52f36bb87ab52eaa68877a64176e (diff)
downloadmongo-1e9edd51844e5e4fd88a37be53d9331642938c95.tar.gz
Add a stat macro so can directly access connection statistics' values;
maintain the checkpoint statistics in the WT_CONNECTION_IMPL statistics structure fields instead of in separate WT_CONNECTION_IMPL fields.
Diffstat (limited to 'src/txn')
-rw-r--r--src/txn/txn_ckpt.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/txn/txn_ckpt.c b/src/txn/txn_ckpt.c
index 7e9b47f2e55..3fa0f786491 100644
--- a/src/txn/txn_ckpt.c
+++ b/src/txn/txn_ckpt.c
@@ -7,9 +7,6 @@
#include "wt_internal.h"
-static void __checkpoint_stats(WT_SESSION_IMPL *,
- struct timespec *, struct timespec *);
-
/*
* __wt_checkpoint_name_ok --
* Complain if the checkpoint name isn't acceptable.
@@ -305,25 +302,20 @@ err: for (i = 0; i < session->ckpt_handle_next; ++i)
* Update checkpoint timer stats.
*/
static void
-__checkpoint_stats(WT_SESSION_IMPL *session,
- struct timespec *start, struct timespec *stop)
+__checkpoint_stats(
+ WT_SESSION_IMPL *session, struct timespec *start, struct timespec *stop)
{
- WT_CONNECTION_IMPL *conn;
uint64_t msec;
- conn = S2C(session);
/*
* Get time diff in microseconds.
*/
- msec = (WT_TIMEDIFF(*stop, *start) / WT_MILLION);
- if (conn->ckpt_min_time == 0 || msec < conn->ckpt_min_time)
- conn->ckpt_min_time = msec;
- if (msec > conn->ckpt_max_time)
- conn->ckpt_max_time = msec;
- WT_STAT_FAST_CONN_SET(session,
- txn_checkpoint_time_max, conn->ckpt_max_time);
- WT_STAT_FAST_CONN_SET(session,
- txn_checkpoint_time_min, conn->ckpt_min_time);
+ msec = WT_TIMEDIFF(*stop, *start) / WT_MILLION;
+ if (msec > WT_CONN_STAT(session, txn_checkpoint_time_max))
+ WT_STAT_FAST_CONN_SET(session, txn_checkpoint_time_max, msec);
+ if (WT_CONN_STAT(session, txn_checkpoint_time_min) == 0 ||
+ msec < WT_CONN_STAT(session, txn_checkpoint_time_min))
+ WT_STAT_FAST_CONN_SET(session, txn_checkpoint_time_min, msec);
WT_STAT_FAST_CONN_SET(session, txn_checkpoint_time_recent, msec);
WT_STAT_FAST_CONN_INCRV(session, txn_checkpoint_time_total, msec);
}