Shows how to access database and table statistics.
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wiredtiger.h>
const char *home = "WT_TEST";
int
{
const char *desc, *pvalue;
uint64_t value;
int ret;
while (
(ret = cursor->
next(cursor)) == 0 &&
(ret = cursor->
get_value(cursor, &desc, &pvalue, &value)) == 0)
printf("%s=%s\n", desc, pvalue);
}
int
{
int ret;
"statistics:", NULL, NULL, &cursor)) != 0)
return (ret);
return (print_cursor(cursor));
}
int
{
int ret;
"statistics:file:access.wt", NULL, NULL, &cursor)) != 0)
return (ret);
return (print_cursor(cursor));
}
int
{
const char *desc, *pvalue;
uint64_t value;
int ret;
"statistics:file:access.wt", NULL, NULL, &cursor)) != 0)
return (ret);
ret = cursor->
get_value(cursor, &desc, &pvalue, &value);
printf("%s=%s\n", desc, pvalue);
return (ret);
}
int
main(void)
{
int ret;
session, "table:access", "key_format=S,value_format=S");
ret = print_database_stats(session);
ret = print_file_stats(session);
ret = print_overflow_pages(session);
return (conn->
close(conn, NULL) == 0 ? ret : EXIT_FAILURE);
}