Commit 3cc827a4 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:3034] Add status info for indexer.

git-svn-id: file:///svn/toku/tokudb@25599 c7de825b-a66e-492c-adef-691d508d4ae1
parent 45824c0c
......@@ -161,6 +161,15 @@ typedef struct __toku_engine_status {
u_int32_t loader_max; /* max number of loaders extant simultaneously */
u_int64_t logsuppress; /* number of times logging is suppressed */
u_int64_t logsuppressfail; /* number of times logging cannot be suppressed */
u_int64_t indexer_create; /* number of indexers created successfully */
u_int64_t indexer_create_fail; /* number of failed indexer creations */
u_int64_t indexer_build; /* number of indexer build calls (succeeded) */
u_int64_t indexer_build_fail; /* number of indexers build calls with error return */
u_int64_t indexer_close; /* number of indexers closed successfully) */
u_int64_t indexer_close_fail; /* number of indexers closed with error return */
u_int64_t indexer_abort; /* number of indexers aborted */
u_int32_t indexer_current; /* number of indexers currently existing */
u_int32_t indexer_max; /* max number of indexers extant simultaneously */
u_int64_t upgrade_env_status; /* Was an environment upgrade done? What was done? */
u_int64_t upgrade_header; /* how many brt headers were upgraded? */
u_int64_t upgrade_nonleaf; /* how many brt nonleaf nodes were upgraded? */
......
......@@ -161,6 +161,15 @@ typedef struct __toku_engine_status {
u_int32_t loader_max; /* max number of loaders extant simultaneously */
u_int64_t logsuppress; /* number of times logging is suppressed */
u_int64_t logsuppressfail; /* number of times logging cannot be suppressed */
u_int64_t indexer_create; /* number of indexers created successfully */
u_int64_t indexer_create_fail; /* number of failed indexer creations */
u_int64_t indexer_build; /* number of indexer build calls (succeeded) */
u_int64_t indexer_build_fail; /* number of indexers build calls with error return */
u_int64_t indexer_close; /* number of indexers closed successfully) */
u_int64_t indexer_close_fail; /* number of indexers closed with error return */
u_int64_t indexer_abort; /* number of indexers aborted */
u_int32_t indexer_current; /* number of indexers currently existing */
u_int32_t indexer_max; /* max number of indexers extant simultaneously */
u_int64_t upgrade_env_status; /* Was an environment upgrade done? What was done? */
u_int64_t upgrade_header; /* how many brt headers were upgraded? */
u_int64_t upgrade_nonleaf; /* how many brt nonleaf nodes were upgraded? */
......
......@@ -161,6 +161,15 @@ typedef struct __toku_engine_status {
u_int32_t loader_max; /* max number of loaders extant simultaneously */
u_int64_t logsuppress; /* number of times logging is suppressed */
u_int64_t logsuppressfail; /* number of times logging cannot be suppressed */
u_int64_t indexer_create; /* number of indexers created successfully */
u_int64_t indexer_create_fail; /* number of failed indexer creations */
u_int64_t indexer_build; /* number of indexer build calls (succeeded) */
u_int64_t indexer_build_fail; /* number of indexers build calls with error return */
u_int64_t indexer_close; /* number of indexers closed successfully) */
u_int64_t indexer_close_fail; /* number of indexers closed with error return */
u_int64_t indexer_abort; /* number of indexers aborted */
u_int32_t indexer_current; /* number of indexers currently existing */
u_int32_t indexer_max; /* max number of indexers extant simultaneously */
u_int64_t upgrade_env_status; /* Was an environment upgrade done? What was done? */
u_int64_t upgrade_header; /* how many brt headers were upgraded? */
u_int64_t upgrade_nonleaf; /* how many brt nonleaf nodes were upgraded? */
......
......@@ -161,6 +161,15 @@ typedef struct __toku_engine_status {
u_int32_t loader_max; /* max number of loaders extant simultaneously */
u_int64_t logsuppress; /* number of times logging is suppressed */
u_int64_t logsuppressfail; /* number of times logging cannot be suppressed */
u_int64_t indexer_create; /* number of indexers created successfully */
u_int64_t indexer_create_fail; /* number of failed indexer creations */
u_int64_t indexer_build; /* number of indexer build calls (succeeded) */
u_int64_t indexer_build_fail; /* number of indexers build calls with error return */
u_int64_t indexer_close; /* number of indexers closed successfully) */
u_int64_t indexer_close_fail; /* number of indexers closed with error return */
u_int64_t indexer_abort; /* number of indexers aborted */
u_int32_t indexer_current; /* number of indexers currently existing */
u_int32_t indexer_max; /* max number of indexers extant simultaneously */
u_int64_t upgrade_env_status; /* Was an environment upgrade done? What was done? */
u_int64_t upgrade_header; /* how many brt headers were upgraded? */
u_int64_t upgrade_nonleaf; /* how many brt nonleaf nodes were upgraded? */
......
......@@ -161,6 +161,15 @@ typedef struct __toku_engine_status {
u_int32_t loader_max; /* max number of loaders extant simultaneously */
u_int64_t logsuppress; /* number of times logging is suppressed */
u_int64_t logsuppressfail; /* number of times logging cannot be suppressed */
u_int64_t indexer_create; /* number of indexers created successfully */
u_int64_t indexer_create_fail; /* number of failed indexer creations */
u_int64_t indexer_build; /* number of indexer build calls (succeeded) */
u_int64_t indexer_build_fail; /* number of indexers build calls with error return */
u_int64_t indexer_close; /* number of indexers closed successfully) */
u_int64_t indexer_close_fail; /* number of indexers closed with error return */
u_int64_t indexer_abort; /* number of indexers aborted */
u_int32_t indexer_current; /* number of indexers currently existing */
u_int32_t indexer_max; /* max number of indexers extant simultaneously */
u_int64_t upgrade_env_status; /* Was an environment upgrade done? What was done? */
u_int64_t upgrade_header; /* how many brt headers were upgraded? */
u_int64_t upgrade_nonleaf; /* how many brt nonleaf nodes were upgraded? */
......
......@@ -547,6 +547,15 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__
printf(" u_int32_t loader_max; /* max number of loaders extant simultaneously */ \n");
printf(" u_int64_t logsuppress; /* number of times logging is suppressed */ \n");
printf(" u_int64_t logsuppressfail; /* number of times logging cannot be suppressed */ \n");
printf(" u_int64_t indexer_create; /* number of indexers created successfully */ \n");
printf(" u_int64_t indexer_create_fail; /* number of failed indexer creations */ \n");
printf(" u_int64_t indexer_build; /* number of indexer build calls (succeeded) */ \n");
printf(" u_int64_t indexer_build_fail; /* number of indexers build calls with error return */ \n");
printf(" u_int64_t indexer_close; /* number of indexers closed successfully) */ \n");
printf(" u_int64_t indexer_close_fail; /* number of indexers closed with error return */ \n");
printf(" u_int64_t indexer_abort; /* number of indexers aborted */ \n");
printf(" u_int32_t indexer_current; /* number of indexers currently existing */ \n");
printf(" u_int32_t indexer_max; /* max number of indexers extant simultaneously */ \n");
printf(" u_int64_t upgrade_env_status; /* Was an environment upgrade done? What was done? */ \n");
printf(" u_int64_t upgrade_header; /* how many brt headers were upgraded? */ \n");
printf(" u_int64_t upgrade_nonleaf; /* how many brt nonleaf nodes were upgraded? */ \n");
......
......@@ -161,6 +161,15 @@ typedef struct __toku_engine_status {
u_int32_t loader_max; /* max number of loaders extant simultaneously */
u_int64_t logsuppress; /* number of times logging is suppressed */
u_int64_t logsuppressfail; /* number of times logging cannot be suppressed */
u_int64_t indexer_create; /* number of indexers created successfully */
u_int64_t indexer_create_fail; /* number of failed indexer creations */
u_int64_t indexer_build; /* number of indexer build calls (succeeded) */
u_int64_t indexer_build_fail; /* number of indexers build calls with error return */
u_int64_t indexer_close; /* number of indexers closed successfully) */
u_int64_t indexer_close_fail; /* number of indexers closed with error return */
u_int64_t indexer_abort; /* number of indexers aborted */
u_int32_t indexer_current; /* number of indexers currently existing */
u_int32_t indexer_max; /* max number of indexers extant simultaneously */
u_int64_t upgrade_env_status; /* Was an environment upgrade done? What was done? */
u_int64_t upgrade_header; /* how many brt headers were upgraded? */
u_int64_t upgrade_nonleaf; /* how many brt nonleaf nodes were upgraded? */
......
......@@ -161,6 +161,15 @@ typedef struct __toku_engine_status {
u_int32_t loader_max; /* max number of loaders extant simultaneously */
u_int64_t logsuppress; /* number of times logging is suppressed */
u_int64_t logsuppressfail; /* number of times logging cannot be suppressed */
u_int64_t indexer_create; /* number of indexers created successfully */
u_int64_t indexer_create_fail; /* number of failed indexer creations */
u_int64_t indexer_build; /* number of indexer build calls (succeeded) */
u_int64_t indexer_build_fail; /* number of indexers build calls with error return */
u_int64_t indexer_close; /* number of indexers closed successfully) */
u_int64_t indexer_close_fail; /* number of indexers closed with error return */
u_int64_t indexer_abort; /* number of indexers aborted */
u_int32_t indexer_current; /* number of indexers currently existing */
u_int32_t indexer_max; /* max number of indexers extant simultaneously */
u_int64_t upgrade_env_status; /* Was an environment upgrade done? What was done? */
u_int64_t upgrade_header; /* how many brt headers were upgraded? */
u_int64_t upgrade_nonleaf; /* how many brt nonleaf nodes were upgraded? */
......
......@@ -221,8 +221,6 @@ static int
build_index(DB_INDEXER *indexer) {
int result = 0;
(void) toku_sync_fetch_and_increment_uint64(&status.build);
DBT key; toku_init_dbt(&key); key.flags = DB_DBT_REALLOC;
DBT le; toku_init_dbt(&le); le.flags = DB_DBT_REALLOC;
......@@ -265,6 +263,13 @@ build_index(DB_INDEXER *indexer) {
// - garbage collect?
// - unique checks?
if ( result == 0 ) {
(void) toku_sync_fetch_and_increment_uint64(&status.build);
} else {
(void) toku_sync_fetch_and_increment_uint64(&status.build_fail);
}
return result;
}
......@@ -275,7 +280,7 @@ close_indexer(DB_INDEXER *indexer) {
toku_ydb_lock();
/*
Add all created dbs to the transactions checkpoint_before_commit list. (This will cause a local checkpoint of created index files, which is necessary because these files are not necessarily on disk and all the operations to create them are not in the recovery log.)
Add all created dbs to the transaction's checkpoint_before_commit list. (This will cause a local checkpoint of created index files, which is necessary because these files are not necessarily on disk and all the operations to create them are not in the recovery log.)
Disassociate the indexer from the hot dbs
*/
disassociate_indexer_from_hot_dbs(indexer);
......
......@@ -45,12 +45,13 @@ void toku_indexer_set_test_only_flags(DB_INDEXER *indexer, int flags) __attribut
typedef struct indexer_status {
uint64_t create; // number of indexers successfully created
uint64_t create_fail; // number of calls to toku_indexer_create_indexer() that failed
uint64_t build; // number of calls to indexer->build()
uint64_t close; // number of calls to indexer->close()
uint64_t build; // number of calls to indexer->build() succeeded
uint64_t build_fail; // number of calls to indexer->build() failed
uint64_t close; // number of calls to indexer->close() that succeeded
uint64_t close_fail; // number of calls to indexer->close() that failed
uint64_t abort; // number of calls to indexer->abort()
uint32_t current; // number of indexers currently in existence
uint32_t max; // max number of indexers that ever existed simulataneously
uint32_t max; // max number of indexers that ever existed simultaneously
} INDEXER_STATUS_S, *INDEXER_STATUS;
void toku_indexer_get_status(INDEXER_STATUS s);
......
......@@ -1838,6 +1838,19 @@ env_get_engine_status(DB_ENV * env, ENGINE_STATUS * engstat, char * env_panic_st
engstat->logsuppress = logsuppress;
engstat->logsuppressfail = logsuppressfail;
}
{
INDEXER_STATUS_S indexer_stat;
toku_indexer_get_status(&indexer_stat);
engstat->indexer_create = indexer_stat.create;
engstat->indexer_create_fail = indexer_stat.create_fail;
engstat->indexer_build = indexer_stat.build;
engstat->indexer_build_fail = indexer_stat.build_fail;
engstat->indexer_close = indexer_stat.close;
engstat->indexer_close_fail = indexer_stat.close_fail;
engstat->indexer_abort = indexer_stat.abort;
engstat->indexer_current = indexer_stat.current;
engstat->indexer_max = indexer_stat.max;
}
{
BRT_UPGRADE_STATUS_S brt_upgrade_stat;
toku_brt_get_upgrade_status(&brt_upgrade_stat);
......@@ -1975,7 +1988,7 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) {
n += snprintf(buff + n, bufsiz - n, "enospc redzone ctr %"PRIu64"\n", engstat.enospc_redzone_ctr);
n += snprintf(buff + n, bufsiz - n, "enospc state %"PRIu64"\n", engstat.enospc_state);
n += snprintf(buff + n, bufsiz - n, "loader_create %"PRIu64"\n", engstat.loader_create);
n += snprintf(buff + n, bufsiz - n, "loader_createf_fail %"PRIu64"\n", engstat.loader_create_fail);
n += snprintf(buff + n, bufsiz - n, "loader_create_fail %"PRIu64"\n", engstat.loader_create_fail);
n += snprintf(buff + n, bufsiz - n, "loader_put %"PRIu64"\n", engstat.loader_put);
n += snprintf(buff + n, bufsiz - n, "loader_close %"PRIu64"\n", engstat.loader_close);
n += snprintf(buff + n, bufsiz - n, "loader_close_fail %"PRIu64"\n", engstat.loader_close_fail);
......@@ -1984,6 +1997,15 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) {
n += snprintf(buff + n, bufsiz - n, "loader_max %"PRIu32"\n", engstat.loader_max);
n += snprintf(buff + n, bufsiz - n, "logsuppress %"PRIu64"\n", engstat.logsuppress);
n += snprintf(buff + n, bufsiz - n, "logsuppressfail %"PRIu64"\n", engstat.logsuppressfail);
n += snprintf(buff + n, bufsiz - n, "indexer_create %"PRIu64"\n", engstat.indexer_create);
n += snprintf(buff + n, bufsiz - n, "indexer_create_fail %"PRIu64"\n", engstat.indexer_create_fail);
n += snprintf(buff + n, bufsiz - n, "indexer_build %"PRIu64"\n", engstat.indexer_build);
n += snprintf(buff + n, bufsiz - n, "indexer_build_fail %"PRIu64"\n", engstat.indexer_build_fail);
n += snprintf(buff + n, bufsiz - n, "indexer_close %"PRIu64"\n", engstat.indexer_close);
n += snprintf(buff + n, bufsiz - n, "indexer_close_fail %"PRIu64"\n", engstat.indexer_close_fail);
n += snprintf(buff + n, bufsiz - n, "indexer_abort %"PRIu64"\n", engstat.indexer_abort);
n += snprintf(buff + n, bufsiz - n, "indexer_current %"PRIu32"\n", engstat.indexer_current);
n += snprintf(buff + n, bufsiz - n, "indexer_max %"PRIu32"\n", engstat.indexer_max);
n += snprintf(buff + n, bufsiz - n, "upgrade_env_status %"PRIu64"\n", engstat.upgrade_env_status);
n += snprintf(buff + n, bufsiz - n, "upgrade_header %"PRIu64"\n", engstat.upgrade_header);
n += snprintf(buff + n, bufsiz - n, "upgrade_nonleaf %"PRIu64"\n", engstat.upgrade_nonleaf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment