summaryrefslogtreecommitdiff
path: root/src/support
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2016-10-18 15:14:27 +1100
committerGitHub <noreply@github.com>2016-10-18 15:14:27 +1100
commit940a7aba6a2c37f878114e8280eabf161a212deb (patch)
tree07da6e852354deb0ea455342590bffc682fdbc2e /src/support
parent349f5349eaaeab99f7a7178e03ab34f8ff0ebd0c (diff)
downloadmongo-940a7aba6a2c37f878114e8280eabf161a212deb.tar.gz
WT-2976 Add a statistic tracking how long app threads spend reading and writing (#3096)
Diffstat (limited to 'src/support')
-rw-r--r--src/support/stat.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/support/stat.c b/src/support/stat.c
index d6457ed64bb..6e8e218a0db 100644
--- a/src/support/stat.c
+++ b/src/support/stat.c
@@ -639,6 +639,10 @@ static const char * const __stats_connection_desc[] = {
"block-manager: bytes written for checkpoint",
"block-manager: mapped blocks read",
"block-manager: mapped bytes read",
+ "cache: application threads page read from disk to cache count",
+ "cache: application threads page read from disk to cache time (usecs)",
+ "cache: application threads page write from cache to disk count",
+ "cache: application threads page write from cache to disk time (usecs)",
"cache: bytes belonging to page images in the cache",
"cache: bytes currently in the cache",
"cache: bytes not belonging to page images in the cache",
@@ -901,6 +905,10 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats)
stats->block_byte_write_checkpoint = 0;
stats->block_map_read = 0;
stats->block_byte_map_read = 0;
+ stats->cache_read_app_count = 0;
+ stats->cache_read_app_time = 0;
+ stats->cache_write_app_count = 0;
+ stats->cache_write_app_time = 0;
/* not clearing cache_bytes_image */
/* not clearing cache_bytes_inuse */
/* not clearing cache_bytes_other */
@@ -1156,6 +1164,11 @@ __wt_stat_connection_aggregate(
WT_STAT_READ(from, block_byte_write_checkpoint);
to->block_map_read += WT_STAT_READ(from, block_map_read);
to->block_byte_map_read += WT_STAT_READ(from, block_byte_map_read);
+ to->cache_read_app_count += WT_STAT_READ(from, cache_read_app_count);
+ to->cache_read_app_time += WT_STAT_READ(from, cache_read_app_time);
+ to->cache_write_app_count +=
+ WT_STAT_READ(from, cache_write_app_count);
+ to->cache_write_app_time += WT_STAT_READ(from, cache_write_app_time);
to->cache_bytes_image += WT_STAT_READ(from, cache_bytes_image);
to->cache_bytes_inuse += WT_STAT_READ(from, cache_bytes_inuse);
to->cache_bytes_other += WT_STAT_READ(from, cache_bytes_other);