diff options
Diffstat (limited to 'examples/c/ex_stat.c')
-rw-r--r-- | examples/c/ex_stat.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/c/ex_stat.c b/examples/c/ex_stat.c index 77d4581680d..9399f45f775 100644 --- a/examples/c/ex_stat.c +++ b/examples/c/ex_stat.c @@ -38,6 +38,7 @@ int print_cursor(WT_CURSOR *); int print_database_stats(WT_SESSION *); int print_file_stats(WT_SESSION *); +int print_lsm_stats(WT_SESSION *); int print_overflow_pages(WT_SESSION *); const char *home = "WT_TEST"; @@ -90,6 +91,25 @@ print_file_stats(WT_SESSION *session) } int +print_lsm_stats(WT_SESSION *session) +{ + WT_CURSOR *cursor; + int ret; + + /* Create an LSM tree, and add some content. */ + ret = session->create(session, + "lsm:access", "key_format=S,value_format=S"); + + /*! [statistics lsm function] */ + if ((ret = session->open_cursor(session, + "statistics:lsm:access", NULL, NULL, &cursor)) != 0) + return (ret); + + return (print_cursor(cursor)); + /*! [statistics lsm function] */ +} + +int print_overflow_pages(WT_SESSION *session) { /*! [statistics retrieve by key] */ @@ -127,6 +147,8 @@ main(void) ret = print_file_stats(session); + ret = print_lsm_stats(session); + ret = print_overflow_pages(session); return (conn->close(conn, NULL) == 0 ? ret : EXIT_FAILURE); |