From a27db763dc3d694bf57ec9755fc1b4f0d06a10ab Mon Sep 17 00:00:00 2001 From: sueloverso Date: Thu, 2 Jun 2016 16:30:39 -0400 Subject: WT-2589 Clear the cursor statistics for LAS when 'clear' is set. (#2772) --- src/cache/cache_las.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/cache') diff --git a/src/cache/cache_las.c b/src/cache/cache_las.c index fd541458fa8..27c2900fa98 100644 --- a/src/cache/cache_las.c +++ b/src/cache/cache_las.c @@ -42,6 +42,17 @@ __wt_las_stats_update(WT_SESSION_IMPL *session) WT_STAT_SET(session, cstats, cache_lookaside_insert, v); v = WT_STAT_READ(dstats, cursor_remove); WT_STAT_SET(session, cstats, cache_lookaside_remove, v); + /* + * If we're clearing stats we need to clear the cursor values we just + * read. This does not clear the rest of the statistics in the + * lookaside data source stat cursor, but we own that namespace so we + * don't have to worry about users seeing inconsistent data source + * information. + */ + if (FLD_ISSET(conn->stat_flags, WT_CONN_STAT_CLEAR)) { + WT_STAT_SET(session, dstats, cursor_insert, 0); + WT_STAT_SET(session, dstats, cursor_remove, 0); + } } /* -- cgit v1.2.1