Commit 610ec250 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:4169] add one more engine status var for cleaner thread leaf merges


git-svn-id: file:///svn/toku/tokudb@38557 c7de825b-a66e-492c-adef-691d508d4ae1
parent 4f5ce011
...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status { ...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status {
uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */ uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */ uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */
uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */ uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */
uint64_t cleaner_num_leaf_merges_running; /* number of cleaner thread leaf merges in progress */
uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */ uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */
uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */ uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */
uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */ uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */
......
...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status { ...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status {
uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */ uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */ uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */
uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */ uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */
uint64_t cleaner_num_leaf_merges_running; /* number of cleaner thread leaf merges in progress */
uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */ uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */
uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */ uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */
uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */ uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */
......
...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status { ...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status {
uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */ uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */ uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */
uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */ uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */
uint64_t cleaner_num_leaf_merges_running; /* number of cleaner thread leaf merges in progress */
uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */ uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */
uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */ uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */
uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */ uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */
......
...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status { ...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status {
uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */ uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */ uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */
uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */ uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */
uint64_t cleaner_num_leaf_merges_running; /* number of cleaner thread leaf merges in progress */
uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */ uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */
uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */ uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */
uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */ uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */
......
...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status { ...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status {
uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */ uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */ uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */
uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */ uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */
uint64_t cleaner_num_leaf_merges_running; /* number of cleaner thread leaf merges in progress */
uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */ uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */
uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */ uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */
uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */ uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */
......
...@@ -591,6 +591,7 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__ ...@@ -591,6 +591,7 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__
printf(" uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */\n"); printf(" uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */\n");
printf(" uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */\n"); printf(" uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */\n");
printf(" uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */\n"); printf(" uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */\n");
printf(" uint64_t cleaner_num_leaf_merges_running; /* number of cleaner thread leaf merges in progress */\n");
printf(" uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */\n"); printf(" uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */\n");
printf(" uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the \"flush from root\" process to merge a leaf node */\n"); printf(" uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the \"flush from root\" process to merge a leaf node */\n");
printf(" uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */\n"); printf(" uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */\n");
......
...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status { ...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status {
uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */ uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */ uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */
uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */ uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */
uint64_t cleaner_num_leaf_merges_running; /* number of cleaner thread leaf merges in progress */
uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */ uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */
uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */ uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */
uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */ uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */
......
...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status { ...@@ -198,6 +198,7 @@ typedef struct __toku_engine_status {
uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */ uint64_t cleaner_min_buffer_workdone; /* min workdone value of any message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */ uint64_t cleaner_total_buffer_workdone; /* total workdone value of message buffers flushed by cleaner thread */
uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */ uint64_t cleaner_num_leaf_merges_started; /* number of times cleaner thread tries to merge a leaf */
uint64_t cleaner_num_leaf_merges_running; /* number of cleaner thread leaf merges in progress */
uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */ uint64_t cleaner_num_leaf_merges_completed; /* number of times cleaner thread successfully merges a leaf */
uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */ uint64_t cleaner_num_dirtied_for_leaf_merge; /* nodes dirtied by the "flush from root" process to merge a leaf node */
uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */ uint64_t flush_total; /* total number of flushes done by flusher threads or cleaner threads */
......
...@@ -371,9 +371,12 @@ ct_maybe_merge_child(struct flusher_advice *fa, ...@@ -371,9 +371,12 @@ ct_maybe_merge_child(struct flusher_advice *fa,
toku_cachetable_call_ydb_unlock(h->cf); toku_cachetable_call_ydb_unlock(h->cf);
(void) __sync_fetch_and_add(&brt_flusher_status.cleaner_num_leaf_merges_started, 1); (void) __sync_fetch_and_add(&brt_flusher_status.cleaner_num_leaf_merges_started, 1);
(void) __sync_fetch_and_add(&brt_flusher_status.cleaner_num_leaf_merges_running, 1);
flush_some_child(h, root_node, &new_fa); flush_some_child(h, root_node, &new_fa);
(void) __sync_fetch_and_add(&brt_flusher_status.cleaner_num_leaf_merges_running, -1);
toku_free(buf); toku_free(buf);
} }
} }
......
...@@ -24,6 +24,7 @@ typedef struct brt_flusher_status { ...@@ -24,6 +24,7 @@ typedef struct brt_flusher_status {
uint64_t cleaner_min_buffer_workdone; uint64_t cleaner_min_buffer_workdone;
uint64_t cleaner_total_buffer_workdone; uint64_t cleaner_total_buffer_workdone;
uint64_t cleaner_num_leaf_merges_started; // number of times cleaner thread tries to merge a leaf uint64_t cleaner_num_leaf_merges_started; // number of times cleaner thread tries to merge a leaf
uint64_t cleaner_num_leaf_merges_running; // number of cleaner thread leaf merges in progress
uint64_t cleaner_num_leaf_merges_completed; // number of times cleaner thread successfully merges a leaf uint64_t cleaner_num_leaf_merges_completed; // number of times cleaner thread successfully merges a leaf
uint64_t cleaner_num_dirtied_for_leaf_merge; // nodes dirtied by the "flush from root" process to merge a leaf node uint64_t cleaner_num_dirtied_for_leaf_merge; // nodes dirtied by the "flush from root" process to merge a leaf node
uint64_t flush_total; // total number of flushes done by flusher threads or cleaner threads uint64_t flush_total; // total number of flushes done by flusher threads or cleaner threads
......
...@@ -2119,6 +2119,7 @@ env_get_engine_status(DB_ENV * env, ENGINE_STATUS * engstat, char * env_panic_st ...@@ -2119,6 +2119,7 @@ env_get_engine_status(DB_ENV * env, ENGINE_STATUS * engstat, char * env_panic_st
engstat->cleaner_min_buffer_workdone = brt_flusher_stat.cleaner_min_buffer_workdone; engstat->cleaner_min_buffer_workdone = brt_flusher_stat.cleaner_min_buffer_workdone;
engstat->cleaner_total_buffer_workdone = brt_flusher_stat.cleaner_total_buffer_workdone; engstat->cleaner_total_buffer_workdone = brt_flusher_stat.cleaner_total_buffer_workdone;
engstat->cleaner_num_leaf_merges_started = brt_flusher_stat.cleaner_num_leaf_merges_started; engstat->cleaner_num_leaf_merges_started = brt_flusher_stat.cleaner_num_leaf_merges_started;
engstat->cleaner_num_leaf_merges_running = brt_flusher_stat.cleaner_num_leaf_merges_running;
engstat->cleaner_num_leaf_merges_completed = brt_flusher_stat.cleaner_num_leaf_merges_completed; engstat->cleaner_num_leaf_merges_completed = brt_flusher_stat.cleaner_num_leaf_merges_completed;
engstat->cleaner_num_dirtied_for_leaf_merge = brt_flusher_stat.cleaner_num_dirtied_for_leaf_merge; engstat->cleaner_num_dirtied_for_leaf_merge = brt_flusher_stat.cleaner_num_dirtied_for_leaf_merge;
engstat->flush_total = brt_flusher_stat.flush_total; engstat->flush_total = brt_flusher_stat.flush_total;
...@@ -2391,6 +2392,7 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) { ...@@ -2391,6 +2392,7 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) {
n += snprintf(buff + n, bufsiz - n, "cleaner_min_buffer_workdone %"PRIu64"\n", engstat.cleaner_min_buffer_workdone); n += snprintf(buff + n, bufsiz - n, "cleaner_min_buffer_workdone %"PRIu64"\n", engstat.cleaner_min_buffer_workdone);
n += snprintf(buff + n, bufsiz - n, "cleaner_total_buffer_workdone %"PRIu64"\n", engstat.cleaner_total_buffer_workdone); n += snprintf(buff + n, bufsiz - n, "cleaner_total_buffer_workdone %"PRIu64"\n", engstat.cleaner_total_buffer_workdone);
n += snprintf(buff + n, bufsiz - n, "cleaner_num_leaf_merges_started %"PRIu64"\n", engstat.cleaner_num_leaf_merges_started); n += snprintf(buff + n, bufsiz - n, "cleaner_num_leaf_merges_started %"PRIu64"\n", engstat.cleaner_num_leaf_merges_started);
n += snprintf(buff + n, bufsiz - n, "cleaner_num_leaf_merges_running %"PRIu64"\n", engstat.cleaner_num_leaf_merges_running);
n += snprintf(buff + n, bufsiz - n, "cleaner_num_leaf_merges_completed %"PRIu64"\n", engstat.cleaner_num_leaf_merges_completed); n += snprintf(buff + n, bufsiz - n, "cleaner_num_leaf_merges_completed %"PRIu64"\n", engstat.cleaner_num_leaf_merges_completed);
n += snprintf(buff + n, bufsiz - n, "cleaner_num_dirtied_for_leaf_merge %"PRIu64"\n", engstat.cleaner_num_dirtied_for_leaf_merge); n += snprintf(buff + n, bufsiz - n, "cleaner_num_dirtied_for_leaf_merge %"PRIu64"\n", engstat.cleaner_num_dirtied_for_leaf_merge);
n += snprintf(buff + n, bufsiz - n, "flush_total %"PRIu64"\n", engstat.flush_total); n += snprintf(buff + n, bufsiz - n, "flush_total %"PRIu64"\n", engstat.flush_total);
......
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