Commit 4bf6a6e4 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:4169] adding engine status variables to count the number of leaf merges

done by a cleaner thread


git-svn-id: file:///svn/toku/tokudb@38556 c7de825b-a66e-492c-adef-691d508d4ae1
parent f8ceefd8
......@@ -197,6 +197,8 @@ typedef struct __toku_engine_status {
uint64_t cleaner_max_buffer_workdone; /* max 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_num_leaf_merges_started; /* number of times cleaner thread tries to merge 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 flush_total; /* total number of flushes done by flusher threads or cleaner threads */
uint64_t flush_in_memory; /* number of in memory flushes */
......
......@@ -197,6 +197,8 @@ typedef struct __toku_engine_status {
uint64_t cleaner_max_buffer_workdone; /* max 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_num_leaf_merges_started; /* number of times cleaner thread tries to merge 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 flush_total; /* total number of flushes done by flusher threads or cleaner threads */
uint64_t flush_in_memory; /* number of in memory flushes */
......
......@@ -197,6 +197,8 @@ typedef struct __toku_engine_status {
uint64_t cleaner_max_buffer_workdone; /* max 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_num_leaf_merges_started; /* number of times cleaner thread tries to merge 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 flush_total; /* total number of flushes done by flusher threads or cleaner threads */
uint64_t flush_in_memory; /* number of in memory flushes */
......
......@@ -197,6 +197,8 @@ typedef struct __toku_engine_status {
uint64_t cleaner_max_buffer_workdone; /* max 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_num_leaf_merges_started; /* number of times cleaner thread tries to merge 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 flush_total; /* total number of flushes done by flusher threads or cleaner threads */
uint64_t flush_in_memory; /* number of in memory flushes */
......
......@@ -197,6 +197,8 @@ typedef struct __toku_engine_status {
uint64_t cleaner_max_buffer_workdone; /* max 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_num_leaf_merges_started; /* number of times cleaner thread tries to merge 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 flush_total; /* total number of flushes done by flusher threads or cleaner threads */
uint64_t flush_in_memory; /* number of in memory flushes */
......
......@@ -590,6 +590,8 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__
printf(" uint64_t cleaner_max_buffer_workdone; /* max 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_num_leaf_merges_started; /* number of times cleaner thread tries to merge 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 flush_total; /* total number of flushes done by flusher threads or cleaner threads */\n");
printf(" uint64_t flush_in_memory; /* number of in memory flushes */\n");
......
......@@ -197,6 +197,8 @@ typedef struct __toku_engine_status {
uint64_t cleaner_max_buffer_workdone; /* max 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_num_leaf_merges_started; /* number of times cleaner thread tries to merge 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 flush_total; /* total number of flushes done by flusher threads or cleaner threads */
uint64_t flush_in_memory; /* number of in memory flushes */
......
......@@ -197,6 +197,8 @@ typedef struct __toku_engine_status {
uint64_t cleaner_max_buffer_workdone; /* max 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_num_leaf_merges_started; /* number of times cleaner thread tries to merge 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 flush_total; /* total number of flushes done by flusher threads or cleaner threads */
uint64_t flush_in_memory; /* number of in memory flushes */
......
......@@ -290,6 +290,20 @@ ctm_update_status(
brt_flusher_status.cleaner_num_dirtied_for_leaf_merge += dirtied;
}
static void
ctm_maybe_merge_child(struct flusher_advice *fa,
struct brt_header *h,
BRTNODE parent,
int childnum,
BRTNODE child,
void *extra)
{
default_merge_child(fa, h, parent, childnum, child, extra);
if (child->height == 0) {
(void) __sync_fetch_and_add(&brt_flusher_status.cleaner_num_leaf_merges_completed, 1);
}
}
static void
ct_maybe_merge_child(struct flusher_advice *fa,
struct brt_header *h,
......@@ -333,7 +347,7 @@ ct_maybe_merge_child(struct flusher_advice *fa,
ctm_pick_child,
dont_destroy_basement_nodes,
always_recursively_flush,
default_merge_child,
ctm_maybe_merge_child,
ctm_update_status,
default_pick_child_after_split,
&ctme);
......@@ -356,6 +370,8 @@ ct_maybe_merge_child(struct flusher_advice *fa,
// layer test, there may be no ydb lock and that is ok
toku_cachetable_call_ydb_unlock(h->cf);
(void) __sync_fetch_and_add(&brt_flusher_status.cleaner_num_leaf_merges_started, 1);
flush_some_child(h, root_node, &new_fa);
toku_free(buf);
......
......@@ -23,6 +23,8 @@ typedef struct brt_flusher_status {
uint64_t cleaner_max_buffer_workdone; // max workdone value of any message buffer flushed by cleaner thread
uint64_t cleaner_min_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_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 flush_total; // total number of flushes done by flusher threads or cleaner threads
uint64_t flush_in_memory; // number of in memory flushes
......
......@@ -2118,6 +2118,8 @@ env_get_engine_status(DB_ENV * env, ENGINE_STATUS * engstat, char * env_panic_st
engstat->cleaner_max_buffer_workdone = brt_flusher_stat.cleaner_max_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_num_leaf_merges_started = brt_flusher_stat.cleaner_num_leaf_merges_started;
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->flush_total = brt_flusher_stat.flush_total;
engstat->flush_in_memory = brt_flusher_stat.flush_in_memory;
......@@ -2388,6 +2390,8 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) {
n += snprintf(buff + n, bufsiz - n, "cleaner_max_buffer_workdone %"PRIu64"\n", engstat.cleaner_max_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_num_leaf_merges_started %"PRIu64"\n", engstat.cleaner_num_leaf_merges_started);
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, "flush_total %"PRIu64"\n", engstat.flush_total);
n += snprintf(buff + n, bufsiz - n, "flush_in_memory %"PRIu64"\n", engstat.flush_in_memory);
......
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