diff options
author | Keith Bostic <keith@wiredtiger.com> | 2015-08-15 11:51:12 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2015-08-15 11:51:12 -0400 |
commit | 87bb029591a9fc8a4dad84549502c91416c4d139 (patch) | |
tree | 41a90be9206e31019fcacdb8bb33ed1c832893e0 /src/async | |
parent | 9817f522ca4964baa804eb5bd38806724406e303 (diff) | |
download | mongo-87bb029591a9fc8a4dad84549502c91416c4d139.tar.gz |
WT-2029, improve scalability of statistics
Instead of using per-thread arrays of counters (see #2102), use arrays
of statistics structures. I started with the scalable_stats branch, so
this incorporates most of the commits on that branch, but the diff is
against the develop branch to make it easier to review.
Specifically, this includes a9675d0:
There are only 3 statistics we maintain atomically: the count
of open cursors and the split-stash bytes and object counts.
Move them to WT_CONNECTION_IMPL fields, and copy them into the
statistics on demand, this allows us to remove support for
atomically maintaining statistics values.
And 6bda287:
Get rid of the WT_CONN_{STAT,STAT_GET,STAT_SET} macros, instead
maintain a few additional fields in the WT_CONNECTION_IMPL
structure (checkpoint min/max, recent and total time).
And 7590930:
Use a prime number of buckets rather than assuming a good hash
(Reference Sedgewick, Algorithms in C, "Hash Functions").
And 63a2082:
I'm seeing a roughly 20% advantage of using a loop to clear the
stats values, vs. a memset to clear the whole padded chunk, and
I'd rather err on the side of writing fewer cache lines, anyway.
Additionally:
Now we have arrays of statistics structures, separate out each statistic
value's description into a separate array, a struct of strings. We could
access it directly, and maybe should, but I'm using a function all at
the moment.
Now the statistic's descriptions are separate from the statistics values,
we no longer need macros to access the fields, in general we can simply
use the stat structure reference and the field name and set the int64_t
directly. This includes removal of the WT_STATS typedef.
Change the LSM code to not maintain a local data-source statistics
structure in each LSM-tree structure -- that allows us to remove all of
the macros to update a single stats structure, and I don't think it
complicates things that much. The changes to the LSM statistics code
should be closely reviewed.
Diffstat (limited to 'src/async')
-rw-r--r-- | src/async/async_api.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/async/async_api.c b/src/async/async_api.c index 9874d7aab00..620f1df7e52 100644 --- a/src/async/async_api.c +++ b/src/async/async_api.c @@ -206,15 +206,15 @@ __wt_async_stats_update(WT_SESSION_IMPL *session) { WT_ASYNC *async; WT_CONNECTION_IMPL *conn; - WT_CONNECTION_STATS *stats; + WT_CONNECTION_STATS **stats; conn = S2C(session); async = conn->async; if (async == NULL) return; - stats = &conn->stats; - WT_STAT_SET(stats, async_cur_queue, async->cur_queue); - WT_STAT_SET(stats, async_max_queue, async->max_queue); + stats = conn->stats; + WT_STAT_SET(session, stats, async_cur_queue, async->cur_queue); + WT_STAT_SET(session, stats, async_max_queue, async->max_queue); F_SET(conn, WT_CONN_SERVER_ASYNC); } |