summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2012-10-15 18:30:48 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2012-10-15 18:30:48 +1100
commit9f77bdb12a0a9a51856b52e2225daa80db43709e (patch)
tree19e1da0e674a5f7c1bded623de2976f66dcc490b /examples
parentb150c326e3e96f108c146b2a0bf3441a123a29c1 (diff)
downloadmongo-9f77bdb12a0a9a51856b52e2225daa80db43709e.tar.gz
At the file level, count successful and failed eviction attempts separately.
Diffstat (limited to 'examples')
-rw-r--r--examples/c/ex_test_perf.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/examples/c/ex_test_perf.c b/examples/c/ex_test_perf.c
index 8ebe91c7601..e5d9c0b1541 100644
--- a/examples/c/ex_test_perf.c
+++ b/examples/c/ex_test_perf.c
@@ -247,9 +247,26 @@ stat_worker(void *arg)
(ret = cursor->get_value(
cursor, &desc, &pvalue, &value)) == 0)
fprintf(cfg->logf,
- "stat:lsm:%s=%s\n", desc, pvalue);
+ "stat:lsm: %s=%s\n", desc, pvalue);
cursor->close(cursor);
+ fprintf(cfg->logf, "\n");
}
+
+ /* Dump the connection statistics since last time. */
+ if ((ret = session->open_cursor(session, "statistics:",
+ NULL, "statistics_clear", &cursor)) != 0) {
+ fprintf(stderr,
+ "open_cursor statistics: %d\n", ret);
+ goto err;
+ }
+ while (
+ (ret = cursor->next(cursor)) == 0 &&
+ (ret = cursor->get_value(
+ cursor, &desc, &pvalue, &value)) == 0)
+ fprintf(cfg->logf,
+ "stat:conn: %s=%s\n", desc, pvalue);
+ cursor->close(cursor);
+
}
err: session->close(session, NULL);
if (lsm_uri != NULL)
@@ -362,8 +379,8 @@ int setup_log_file(CONFIG *cfg)
fprintf(stderr, "Statistics failed to open log file.\n");
return (EINVAL);
}
- /* Turn off buffering for the log file. */
- (void)setvbuf(cfg->logf, NULL, _IONBF, 0);
+ /* Use line buffering for the log file. */
+ (void)setvbuf(cfg->logf, NULL, _IOLBF, 0);
if (fname != NULL)
free(fname);
return (0);