diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/c/ex_stat.c | 9 |
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] */ } |