Commit 8361d372 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:3988] #3988 Add some instrumentation. More to come...

git-svn-id: file:///svn/toku/tokudb@36814 c7de825b-a66e-492c-adef-691d508d4ae1
parent e5bce485
...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status { ...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status {
u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */ u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */
u_int32_t checkpoint_count; /* number of checkpoints taken */ u_int32_t checkpoint_count; /* number of checkpoints taken */
u_int32_t checkpoint_count_fail; /* number of checkpoints failed */ u_int32_t checkpoint_count_fail; /* number of checkpoints failed */
u_int32_t cleaner_period; /* delay between automatic checkpoints */ u_int32_t cleaner_period; /* delay between executions of cleaner */
u_int32_t cleaner_iterations; /* delay between automatic checkpoints */ u_int32_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
u_int64_t txn_commit; /* txn commit operations */ u_int64_t txn_commit; /* txn commit operations */
u_int64_t txn_abort; /* txn abort operations */ u_int64_t txn_abort; /* txn abort operations */
...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status { ...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status {
uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */ uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */
uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */ uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */
uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */ uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */
uint64_t cleaner_total_nodes; /* total number of nodes whose buffers are potentially flushed by cleaner thread */
uint64_t cleaner_h1_nodes; /* number of nodes of height one whose message buffers are flushed by cleaner thread */
uint64_t cleaner_hgt1_nodes; /* number of nodes of height > 1 whose message buffers are flushed by cleaner thread */
uint64_t cleaner_empty_nodes; /* number of nodes that are selected by cleaner, but whose buffers are empty */
uint64_t cleaner_nodes_dirtied; /* number of nodes that are made dirty by the cleaner thread */
uint64_t cleaner_max_buffer_size; /* max number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_min_buffer_size; /* min number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_size; /* total number of bytes in message buffers flushed by cleaner thread */
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 */
u_int64_t point_queries; /* ydb point queries */ u_int64_t point_queries; /* ydb point queries */
u_int64_t sequential_queries; /* ydb sequential queries */ u_int64_t sequential_queries; /* ydb sequential queries */
u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */ u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */
......
...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status { ...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status {
u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */ u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */
u_int32_t checkpoint_count; /* number of checkpoints taken */ u_int32_t checkpoint_count; /* number of checkpoints taken */
u_int32_t checkpoint_count_fail; /* number of checkpoints failed */ u_int32_t checkpoint_count_fail; /* number of checkpoints failed */
u_int32_t cleaner_period; /* delay between automatic checkpoints */ u_int32_t cleaner_period; /* delay between executions of cleaner */
u_int32_t cleaner_iterations; /* delay between automatic checkpoints */ u_int32_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
u_int64_t txn_commit; /* txn commit operations */ u_int64_t txn_commit; /* txn commit operations */
u_int64_t txn_abort; /* txn abort operations */ u_int64_t txn_abort; /* txn abort operations */
...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status { ...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status {
uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */ uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */
uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */ uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */
uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */ uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */
uint64_t cleaner_total_nodes; /* total number of nodes whose buffers are potentially flushed by cleaner thread */
uint64_t cleaner_h1_nodes; /* number of nodes of height one whose message buffers are flushed by cleaner thread */
uint64_t cleaner_hgt1_nodes; /* number of nodes of height > 1 whose message buffers are flushed by cleaner thread */
uint64_t cleaner_empty_nodes; /* number of nodes that are selected by cleaner, but whose buffers are empty */
uint64_t cleaner_nodes_dirtied; /* number of nodes that are made dirty by the cleaner thread */
uint64_t cleaner_max_buffer_size; /* max number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_min_buffer_size; /* min number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_size; /* total number of bytes in message buffers flushed by cleaner thread */
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 */
u_int64_t point_queries; /* ydb point queries */ u_int64_t point_queries; /* ydb point queries */
u_int64_t sequential_queries; /* ydb sequential queries */ u_int64_t sequential_queries; /* ydb sequential queries */
u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */ u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */
......
...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status { ...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status {
u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */ u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */
u_int32_t checkpoint_count; /* number of checkpoints taken */ u_int32_t checkpoint_count; /* number of checkpoints taken */
u_int32_t checkpoint_count_fail; /* number of checkpoints failed */ u_int32_t checkpoint_count_fail; /* number of checkpoints failed */
u_int32_t cleaner_period; /* delay between automatic checkpoints */ u_int32_t cleaner_period; /* delay between executions of cleaner */
u_int32_t cleaner_iterations; /* delay between automatic checkpoints */ u_int32_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
u_int64_t txn_commit; /* txn commit operations */ u_int64_t txn_commit; /* txn commit operations */
u_int64_t txn_abort; /* txn abort operations */ u_int64_t txn_abort; /* txn abort operations */
...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status { ...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status {
uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */ uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */
uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */ uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */
uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */ uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */
uint64_t cleaner_total_nodes; /* total number of nodes whose buffers are potentially flushed by cleaner thread */
uint64_t cleaner_h1_nodes; /* number of nodes of height one whose message buffers are flushed by cleaner thread */
uint64_t cleaner_hgt1_nodes; /* number of nodes of height > 1 whose message buffers are flushed by cleaner thread */
uint64_t cleaner_empty_nodes; /* number of nodes that are selected by cleaner, but whose buffers are empty */
uint64_t cleaner_nodes_dirtied; /* number of nodes that are made dirty by the cleaner thread */
uint64_t cleaner_max_buffer_size; /* max number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_min_buffer_size; /* min number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_size; /* total number of bytes in message buffers flushed by cleaner thread */
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 */
u_int64_t point_queries; /* ydb point queries */ u_int64_t point_queries; /* ydb point queries */
u_int64_t sequential_queries; /* ydb sequential queries */ u_int64_t sequential_queries; /* ydb sequential queries */
u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */ u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */
......
...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status { ...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status {
u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */ u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */
u_int32_t checkpoint_count; /* number of checkpoints taken */ u_int32_t checkpoint_count; /* number of checkpoints taken */
u_int32_t checkpoint_count_fail; /* number of checkpoints failed */ u_int32_t checkpoint_count_fail; /* number of checkpoints failed */
u_int32_t cleaner_period; /* delay between automatic checkpoints */ u_int32_t cleaner_period; /* delay between executions of cleaner */
u_int32_t cleaner_iterations; /* delay between automatic checkpoints */ u_int32_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
u_int64_t txn_commit; /* txn commit operations */ u_int64_t txn_commit; /* txn commit operations */
u_int64_t txn_abort; /* txn abort operations */ u_int64_t txn_abort; /* txn abort operations */
...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status { ...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status {
uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */ uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */
uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */ uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */
uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */ uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */
uint64_t cleaner_total_nodes; /* total number of nodes whose buffers are potentially flushed by cleaner thread */
uint64_t cleaner_h1_nodes; /* number of nodes of height one whose message buffers are flushed by cleaner thread */
uint64_t cleaner_hgt1_nodes; /* number of nodes of height > 1 whose message buffers are flushed by cleaner thread */
uint64_t cleaner_empty_nodes; /* number of nodes that are selected by cleaner, but whose buffers are empty */
uint64_t cleaner_nodes_dirtied; /* number of nodes that are made dirty by the cleaner thread */
uint64_t cleaner_max_buffer_size; /* max number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_min_buffer_size; /* min number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_size; /* total number of bytes in message buffers flushed by cleaner thread */
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 */
u_int64_t point_queries; /* ydb point queries */ u_int64_t point_queries; /* ydb point queries */
u_int64_t sequential_queries; /* ydb sequential queries */ u_int64_t sequential_queries; /* ydb sequential queries */
u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */ u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */
......
...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status { ...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status {
u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */ u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */
u_int32_t checkpoint_count; /* number of checkpoints taken */ u_int32_t checkpoint_count; /* number of checkpoints taken */
u_int32_t checkpoint_count_fail; /* number of checkpoints failed */ u_int32_t checkpoint_count_fail; /* number of checkpoints failed */
u_int32_t cleaner_period; /* delay between automatic checkpoints */ u_int32_t cleaner_period; /* delay between executions of cleaner */
u_int32_t cleaner_iterations; /* delay between automatic checkpoints */ u_int32_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
u_int64_t txn_commit; /* txn commit operations */ u_int64_t txn_commit; /* txn commit operations */
u_int64_t txn_abort; /* txn abort operations */ u_int64_t txn_abort; /* txn abort operations */
...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status { ...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status {
uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */ uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */
uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */ uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */
uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */ uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */
uint64_t cleaner_total_nodes; /* total number of nodes whose buffers are potentially flushed by cleaner thread */
uint64_t cleaner_h1_nodes; /* number of nodes of height one whose message buffers are flushed by cleaner thread */
uint64_t cleaner_hgt1_nodes; /* number of nodes of height > 1 whose message buffers are flushed by cleaner thread */
uint64_t cleaner_empty_nodes; /* number of nodes that are selected by cleaner, but whose buffers are empty */
uint64_t cleaner_nodes_dirtied; /* number of nodes that are made dirty by the cleaner thread */
uint64_t cleaner_max_buffer_size; /* max number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_min_buffer_size; /* min number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_size; /* total number of bytes in message buffers flushed by cleaner thread */
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 */
u_int64_t point_queries; /* ydb point queries */ u_int64_t point_queries; /* ydb point queries */
u_int64_t sequential_queries; /* ydb sequential queries */ u_int64_t sequential_queries; /* ydb sequential queries */
u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */ u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */
......
...@@ -480,8 +480,8 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__ ...@@ -480,8 +480,8 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__
printf(" u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */ \n"); printf(" u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */ \n");
printf(" u_int32_t checkpoint_count; /* number of checkpoints taken */ \n"); printf(" u_int32_t checkpoint_count; /* number of checkpoints taken */ \n");
printf(" u_int32_t checkpoint_count_fail; /* number of checkpoints failed */ \n"); printf(" u_int32_t checkpoint_count_fail; /* number of checkpoints failed */ \n");
printf(" u_int32_t cleaner_period; /* delay between automatic checkpoints */ \n"); printf(" u_int32_t cleaner_period; /* delay between executions of cleaner */ \n");
printf(" u_int32_t cleaner_iterations; /* delay between automatic checkpoints */ \n"); printf(" u_int32_t cleaner_iterations; /* number of nodes to flush per cleaner execution */ \n");
printf(" u_int64_t txn_begin; /* number of transactions ever begun */ \n"); printf(" u_int64_t txn_begin; /* number of transactions ever begun */ \n");
printf(" u_int64_t txn_commit; /* txn commit operations */ \n"); printf(" u_int64_t txn_commit; /* txn commit operations */ \n");
printf(" u_int64_t txn_abort; /* txn abort operations */ \n"); printf(" u_int64_t txn_abort; /* txn abort operations */ \n");
...@@ -562,6 +562,17 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__ ...@@ -562,6 +562,17 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__
printf(" uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */ \n"); printf(" uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */ \n");
printf(" uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */ \n"); printf(" uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */ \n");
printf(" uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */ \n"); printf(" uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */ \n");
printf(" uint64_t cleaner_total_nodes; /* total number of nodes whose buffers are potentially flushed by cleaner thread */\n");
printf(" uint64_t cleaner_h1_nodes; /* number of nodes of height one whose message buffers are flushed by cleaner thread */\n");
printf(" uint64_t cleaner_hgt1_nodes; /* number of nodes of height > 1 whose message buffers are flushed by cleaner thread */\n");
printf(" uint64_t cleaner_empty_nodes; /* number of nodes that are selected by cleaner, but whose buffers are empty */\n");
printf(" uint64_t cleaner_nodes_dirtied; /* number of nodes that are made dirty by the cleaner thread */\n");
printf(" uint64_t cleaner_max_buffer_size; /* max number of bytes in message buffer flushed by cleaner thread */\n");
printf(" uint64_t cleaner_min_buffer_size; /* min number of bytes in message buffer flushed by cleaner thread */\n");
printf(" uint64_t cleaner_total_buffer_size; /* total number of bytes in message buffers flushed by cleaner thread */\n");
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(" u_int64_t point_queries; /* ydb point queries */ \n"); printf(" u_int64_t point_queries; /* ydb point queries */ \n");
printf(" u_int64_t sequential_queries; /* ydb sequential queries */ \n"); printf(" u_int64_t sequential_queries; /* ydb sequential queries */ \n");
printf(" u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */ \n"); printf(" u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */ \n");
......
...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status { ...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status {
u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */ u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */
u_int32_t checkpoint_count; /* number of checkpoints taken */ u_int32_t checkpoint_count; /* number of checkpoints taken */
u_int32_t checkpoint_count_fail; /* number of checkpoints failed */ u_int32_t checkpoint_count_fail; /* number of checkpoints failed */
u_int32_t cleaner_period; /* delay between automatic checkpoints */ u_int32_t cleaner_period; /* delay between executions of cleaner */
u_int32_t cleaner_iterations; /* delay between automatic checkpoints */ u_int32_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
u_int64_t txn_commit; /* txn commit operations */ u_int64_t txn_commit; /* txn commit operations */
u_int64_t txn_abort; /* txn abort operations */ u_int64_t txn_abort; /* txn abort operations */
...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status { ...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status {
uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */ uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */
uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */ uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */
uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */ uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */
uint64_t cleaner_total_nodes; /* total number of nodes whose buffers are potentially flushed by cleaner thread */
uint64_t cleaner_h1_nodes; /* number of nodes of height one whose message buffers are flushed by cleaner thread */
uint64_t cleaner_hgt1_nodes; /* number of nodes of height > 1 whose message buffers are flushed by cleaner thread */
uint64_t cleaner_empty_nodes; /* number of nodes that are selected by cleaner, but whose buffers are empty */
uint64_t cleaner_nodes_dirtied; /* number of nodes that are made dirty by the cleaner thread */
uint64_t cleaner_max_buffer_size; /* max number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_min_buffer_size; /* min number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_size; /* total number of bytes in message buffers flushed by cleaner thread */
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 */
u_int64_t point_queries; /* ydb point queries */ u_int64_t point_queries; /* ydb point queries */
u_int64_t sequential_queries; /* ydb sequential queries */ u_int64_t sequential_queries; /* ydb sequential queries */
u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */ u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */
......
...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status { ...@@ -86,8 +86,8 @@ typedef struct __toku_engine_status {
u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */ u_int64_t checkpoint_last_lsn; /* LSN of last complete checkpoint */
u_int32_t checkpoint_count; /* number of checkpoints taken */ u_int32_t checkpoint_count; /* number of checkpoints taken */
u_int32_t checkpoint_count_fail; /* number of checkpoints failed */ u_int32_t checkpoint_count_fail; /* number of checkpoints failed */
u_int32_t cleaner_period; /* delay between automatic checkpoints */ u_int32_t cleaner_period; /* delay between executions of cleaner */
u_int32_t cleaner_iterations; /* delay between automatic checkpoints */ u_int32_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
u_int64_t txn_commit; /* txn commit operations */ u_int64_t txn_commit; /* txn commit operations */
u_int64_t txn_abort; /* txn abort operations */ u_int64_t txn_abort; /* txn abort operations */
...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status { ...@@ -168,6 +168,17 @@ typedef struct __toku_engine_status {
uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */ uint64_t search_root_retries; /* number of searches that required the root node to be fetched more than once */
uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */ uint64_t search_tries_gt_height; /* number of searches that required more tries than the height of the tree */
uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */ uint64_t search_tries_gt_heightplus3; /* number of searches that required more tries than the height of the tree plus three */
uint64_t cleaner_total_nodes; /* total number of nodes whose buffers are potentially flushed by cleaner thread */
uint64_t cleaner_h1_nodes; /* number of nodes of height one whose message buffers are flushed by cleaner thread */
uint64_t cleaner_hgt1_nodes; /* number of nodes of height > 1 whose message buffers are flushed by cleaner thread */
uint64_t cleaner_empty_nodes; /* number of nodes that are selected by cleaner, but whose buffers are empty */
uint64_t cleaner_nodes_dirtied; /* number of nodes that are made dirty by the cleaner thread */
uint64_t cleaner_max_buffer_size; /* max number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_min_buffer_size; /* min number of bytes in message buffer flushed by cleaner thread */
uint64_t cleaner_total_buffer_size; /* total number of bytes in message buffers flushed by cleaner thread */
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 */
u_int64_t point_queries; /* ydb point queries */ u_int64_t point_queries; /* ydb point queries */
u_int64_t sequential_queries; /* ydb sequential queries */ u_int64_t sequential_queries; /* ydb sequential queries */
u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */ u_int64_t le_max_committed_xr; /* max committed transaction records in any packed le */
......
...@@ -747,6 +747,17 @@ typedef struct brt_status { ...@@ -747,6 +747,17 @@ typedef struct brt_status {
uint64_t search_root_retries; // number of searches that required the root node to be fetched more than once uint64_t search_root_retries; // number of searches that required the root node to be fetched more than once
uint64_t search_tries_gt_height; // number of searches that required more tries than the height of the tree uint64_t search_tries_gt_height; // number of searches that required more tries than the height of the tree
uint64_t search_tries_gt_heightplus3; // number of searches that required more tries than the height of the tree plus three uint64_t search_tries_gt_heightplus3; // number of searches that required more tries than the height of the tree plus three
uint64_t cleaner_total_nodes; // total number of nodes whose buffers are potentially flushed by cleaner thread
uint64_t cleaner_h1_nodes; // number of nodes of height one whose message buffers are flushed by cleaner thread
uint64_t cleaner_hgt1_nodes; // number of nodes of height > 1 whose message buffers are flushed by cleaner thread
uint64_t cleaner_empty_nodes; // number of nodes that are selected by cleaner, but whose buffers are empty
uint64_t cleaner_nodes_dirtied; // number of nodes that are made dirty by the cleaner thread
uint64_t cleaner_max_buffer_size; // max number of bytes in message buffer flushed by cleaner thread
uint64_t cleaner_min_buffer_size;
uint64_t cleaner_total_buffer_size;
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;
} BRT_STATUS_S, *BRT_STATUS; } BRT_STATUS_S, *BRT_STATUS;
void toku_brt_get_status(BRT_STATUS); void toku_brt_get_status(BRT_STATUS);
......
...@@ -858,24 +858,57 @@ int toku_brtnode_pe_callback (void *brtnode_pv, PAIR_ATTR UU(old_attr), PAIR_ATT ...@@ -858,24 +858,57 @@ int toku_brtnode_pe_callback (void *brtnode_pv, PAIR_ATTR UU(old_attr), PAIR_ATT
static void flush_some_child(struct brt_header* h, BRTNODE node); static void flush_some_child(struct brt_header* h, BRTNODE node);
static void bring_node_fully_into_memory(BRTNODE node, struct brt_header *h); static void bring_node_fully_into_memory(BRTNODE node, struct brt_header *h);
// TODO 3988 Leif set cleaner_nodes_dirtied
static void
update_cleaner_status(BRTNODE node, int childnum)
{
brt_status.cleaner_total_nodes++;
if (node->height == 1) {
brt_status.cleaner_h1_nodes++;
} else {
brt_status.cleaner_hgt1_nodes++;
}
unsigned int nbytesinbuf = toku_bnc_nbytesinbuf(BNC(node, childnum));
if (nbytesinbuf == 0) {
brt_status.cleaner_empty_nodes++;
} else {
if (nbytesinbuf > brt_status.cleaner_max_buffer_size) {
brt_status.cleaner_max_buffer_size = nbytesinbuf;
}
if (nbytesinbuf < brt_status.cleaner_min_buffer_size) {
brt_status.cleaner_min_buffer_size = nbytesinbuf;
}
brt_status.cleaner_total_buffer_size += nbytesinbuf;
uint64_t workdone = BP_WORKDONE(node, childnum);
if (workdone > brt_status.cleaner_max_buffer_workdone) {
brt_status.cleaner_max_buffer_workdone = workdone;
}
if (workdone < brt_status.cleaner_min_buffer_workdone) {
brt_status.cleaner_min_buffer_workdone = workdone;
}
brt_status.cleaner_total_buffer_workdone += workdone;
}
}
static void find_heaviest_child (BRTNODE node, int *childnum);
int int
toku_brtnode_cleaner_callback(void *brtnode_pv, BLOCKNUM blocknum, u_int32_t fullhash, void *extraargs) toku_brtnode_cleaner_callback(void *brtnode_pv, BLOCKNUM blocknum, u_int32_t fullhash, void *extraargs)
{ {
BRTNODE node = brtnode_pv; BRTNODE node = brtnode_pv;
assert(node->thisnodename.b == blocknum.b); invariant(node->thisnodename.b == blocknum.b);
assert(node->fullhash == fullhash); invariant(node->fullhash == fullhash);
assert(node->height > 0); // we should never pick a leaf node (for now at least) invariant(node->height > 0); // we should never pick a leaf node (for now at least)
struct brt_header *h = extraargs; struct brt_header *h = extraargs;
bring_node_fully_into_memory(node, h); bring_node_fully_into_memory(node, h);
bool is_empty = true; int childnum;
for (int i = 0; i < node->n_children; ++i) { find_heaviest_child(node, &childnum);
if (toku_bnc_nbytesinbuf(BNC(node, i)) > 0) { update_cleaner_status(node, childnum);
is_empty = false;
break;
}
}
// Either flush_some_child will unlock the node, or we do it here. // Either flush_some_child will unlock the node, or we do it here.
if (!is_empty) { if (toku_bnc_nbytesinbuf(BNC(node, childnum)) > 0) {
flush_some_child(h, node); flush_some_child(h, node);
} else { } else {
toku_unpin_brtnode_off_client_thread(h, node); toku_unpin_brtnode_off_client_thread(h, node);
...@@ -897,7 +930,7 @@ brt_status_update_partial_fetch(u_int8_t state) ...@@ -897,7 +930,7 @@ brt_status_update_partial_fetch(u_int8_t state)
brt_status.partial_fetch_miss++; brt_status.partial_fetch_miss++;
} }
else { else {
assert(FALSE); invariant(FALSE);
} }
} }
...@@ -7281,6 +7314,8 @@ int toku_brt_init(void (*ydb_lock_callback)(void), ...@@ -7281,6 +7314,8 @@ int toku_brt_init(void (*ydb_lock_callback)(void),
r = toku_brt_serialize_init(); r = toku_brt_serialize_init();
if (r==0) if (r==0)
callback_db_set_brt = db_set_brt; callback_db_set_brt = db_set_brt;
brt_status.cleaner_min_buffer_size = UINT64_MAX;
brt_status.cleaner_min_buffer_workdone = UINT64_MAX;
return r; return r;
} }
......
...@@ -2042,6 +2042,17 @@ env_get_engine_status(DB_ENV * env, ENGINE_STATUS * engstat, char * env_panic_st ...@@ -2042,6 +2042,17 @@ env_get_engine_status(DB_ENV * env, ENGINE_STATUS * engstat, char * env_panic_st
engstat->search_root_retries = brt_stat.search_root_retries; engstat->search_root_retries = brt_stat.search_root_retries;
engstat->search_tries_gt_height = brt_stat.search_tries_gt_height; engstat->search_tries_gt_height = brt_stat.search_tries_gt_height;
engstat->search_tries_gt_heightplus3 = brt_stat.search_tries_gt_heightplus3; engstat->search_tries_gt_heightplus3 = brt_stat.search_tries_gt_heightplus3;
engstat->cleaner_total_nodes = brt_stat.cleaner_total_nodes;
engstat->cleaner_h1_nodes = brt_stat.cleaner_h1_nodes;
engstat->cleaner_hgt1_nodes = brt_stat.cleaner_hgt1_nodes;
engstat->cleaner_empty_nodes = brt_stat.cleaner_empty_nodes;
engstat->cleaner_nodes_dirtied = brt_stat.cleaner_nodes_dirtied;
engstat->cleaner_max_buffer_size = brt_stat.cleaner_max_buffer_size;
engstat->cleaner_min_buffer_size = brt_stat.cleaner_min_buffer_size;
engstat->cleaner_total_buffer_size = brt_stat.cleaner_total_buffer_size;
engstat->cleaner_max_buffer_workdone = brt_stat.cleaner_max_buffer_workdone;
engstat->cleaner_min_buffer_workdone = brt_stat.cleaner_min_buffer_workdone;
engstat->cleaner_total_buffer_workdone = brt_stat.cleaner_total_buffer_workdone;
} }
{ {
u_int64_t fsync_count, fsync_time; u_int64_t fsync_count, fsync_time;
...@@ -2261,6 +2272,19 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) { ...@@ -2261,6 +2272,19 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) {
n += snprintf(buff + n, bufsiz - n, "search_root_retries %"PRIu64"\n", engstat.search_root_retries); n += snprintf(buff + n, bufsiz - n, "search_root_retries %"PRIu64"\n", engstat.search_root_retries);
n += snprintf(buff + n, bufsiz - n, "search_tries_gt_height %"PRIu64"\n", engstat.search_tries_gt_height); n += snprintf(buff + n, bufsiz - n, "search_tries_gt_height %"PRIu64"\n", engstat.search_tries_gt_height);
n += snprintf(buff + n, bufsiz - n, "search_tries_gt_heightplus3 %"PRIu64"\n", engstat.search_tries_gt_heightplus3); n += snprintf(buff + n, bufsiz - n, "search_tries_gt_heightplus3 %"PRIu64"\n", engstat.search_tries_gt_heightplus3);
n += snprintf(buff + n, bufsiz - n, "cleaner_total_nodes %"PRIu64"\n", engstat.cleaner_total_nodes);
n += snprintf(buff + n, bufsiz - n, "cleaner_h1_nodes %"PRIu64"\n", engstat.cleaner_h1_nodes);
n += snprintf(buff + n, bufsiz - n, "cleaner_hgt1_nodes %"PRIu64"\n", engstat.cleaner_hgt1_nodes);
n += snprintf(buff + n, bufsiz - n, "cleaner_empty_nodes %"PRIu64"\n", engstat.cleaner_empty_nodes);
n += snprintf(buff + n, bufsiz - n, "cleaner_nodes_dirtied %"PRIu64"\n", engstat.cleaner_nodes_dirtied);
n += snprintf(buff + n, bufsiz - n, "cleaner_max_buffer_size %"PRIu64"\n", engstat.cleaner_max_buffer_size);
n += snprintf(buff + n, bufsiz - n, "cleaner_min_buffer_size %"PRIu64"\n", engstat.cleaner_min_buffer_size);
n += snprintf(buff + n, bufsiz - n, "cleaner_total_buffer_size %"PRIu64"\n", engstat.cleaner_total_buffer_size);
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_period %"PRIu32"\n", engstat.cleaner_period);
n += snprintf(buff + n, bufsiz - n, "cleaner_iterations %"PRIu32"\n", engstat.cleaner_iterations);
n += snprintf(buff + n, bufsiz - n, "multi_inserts %"PRIu64"\n", engstat.multi_inserts); n += snprintf(buff + n, bufsiz - n, "multi_inserts %"PRIu64"\n", engstat.multi_inserts);
n += snprintf(buff + n, bufsiz - n, "multi_inserts_fail %"PRIu64"\n", engstat.multi_inserts_fail); n += snprintf(buff + n, bufsiz - n, "multi_inserts_fail %"PRIu64"\n", engstat.multi_inserts_fail);
n += snprintf(buff + n, bufsiz - n, "multi_deletes %"PRIu64"\n", engstat.multi_deletes); n += snprintf(buff + n, bufsiz - n, "multi_deletes %"PRIu64"\n", engstat.multi_deletes);
......
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