summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2012-12-06 11:38:36 +0000
committerKeith Bostic <keith@wiredtiger.com>2012-12-06 11:38:36 +0000
commit0c386e22a26f993a881f2d4b572c9c2d74396a53 (patch)
tree38f8a55b33145738532f0d3a2ad97152578e85d7 /examples
parent644e019d85c820f45e79f7bbd73ec4c39b25f8ea (diff)
downloadmongo-0c386e22a26f993a881f2d4b572c9c2d74396a53.tar.gz
Split cache_bytes_changed into cursor_{insert,remove,update}_bytes and
maintain three separate statistics.
Diffstat (limited to 'examples')
-rw-r--r--examples/c/ex_stat.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/c/ex_stat.c b/examples/c/ex_stat.c
index 791464f8d7b..93a7a44e9f0 100644
--- a/examples/c/ex_stat.c
+++ b/examples/c/ex_stat.c
@@ -161,13 +161,16 @@ print_derived_stats(WT_SESSION *session)
{
/*! [statistics calculate write amplification] */
- uint64_t app_writes, fs_writes;
+ uint64_t app_insert, app_remove, app_update, fs_writes;
+
+ ret = get_stat(cursor, WT_STAT_DSRC_CURSOR_INSERT_BYTES, &app_insert);
+ ret = get_stat(cursor, WT_STAT_DSRC_CURSOR_REMOVE_BYTES, &app_remove);
+ ret = get_stat(cursor, WT_STAT_DSRC_CURSOR_UPDATE_BYTES, &app_update);
ret = get_stat(cursor, WT_STAT_DSRC_CACHE_BYTES_WRITE, &fs_writes);
- ret = get_stat(cursor, WT_STAT_DSRC_CACHE_BYTES_CHANGED, &app_writes);
printf("Write amplification is %.2lf\n",
- (double)fs_writes / app_writes);
+ (double)fs_writes / (app_insert + app_remove + app_update));
/*! [statistics calculate write amplification] */
}