Commit c27fc7af authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:4355] Improve engine status, deleting obsolete fields, adding...

[t:4355] Improve engine status, deleting obsolete fields, adding cachetable_size_cachepressure, resequencing.  Refs #4355.

git-svn-id: file:///svn/toku/tokudb@38528 c7de825b-a66e-492c-adef-691d508d4ae1
parent 50ebd65f
......@@ -37,22 +37,19 @@ static void cachetable_partial_reader(WORKITEM);
#endif
// these should be in the cachetable object, but we make them file-wide so that gdb can get them easily
static u_int64_t cachetable_lock_taken = 0;
static u_int64_t cachetable_lock_released = 0;
static u_int64_t cachetable_hit;
static u_int64_t cachetable_miss;
static u_int64_t cachetable_misstime; // time spent waiting for disk read
static u_int64_t cachetable_waittime; // time spent waiting for another thread to release lock (e.g. prefetch, writing)
static u_int64_t cachetable_wait_reading; // how many times does get_and_pin() wait for a node to be read?
static u_int64_t cachetable_wait_writing; // how many times does get_and_pin() wait for a node to be written?
static u_int64_t cachetable_wait_checkpoint; // number of times get_and_pin waits for a node to be written for a checkpoint
static u_int64_t cachetable_puts; // how many times has a newly created node been put into the cachetable?
static u_int64_t cachetable_prefetches; // how many times has a block been prefetched into the cachetable?
static u_int64_t cachetable_maybe_get_and_pins; // how many times has maybe_get_and_pin(_clean) been called?
static u_int64_t cachetable_maybe_get_and_pin_hits; // how many times has get_and_pin(_clean) returned with a node?
static u_int64_t cachetable_wait_checkpoint; // number of times get_and_pin waits for a node to be written for a checkpoint
static u_int64_t cachetable_misstime; // time spent waiting for disk read
static u_int64_t cachetable_waittime; // time spent waiting for another thread to release lock (e.g. prefetch, writing)
static u_int64_t cachetable_lock_taken = 0;
static u_int64_t cachetable_lock_released = 0;
static u_int64_t local_checkpoint; // number of times a local checkpoint was taken for a commit (2440)
static u_int64_t local_checkpoint_files; // number of files subject to local checkpoint taken for a commit (2440)
static u_int64_t local_checkpoint_during_checkpoint; // number of times a local checkpoint happened during normal checkpoint (2440)
static u_int64_t cachetable_evictions;
static u_int64_t cleaner_executions; // number of times the cleaner thread's loop has executed
......@@ -3718,16 +3715,12 @@ void toku_cachetable_get_status(CACHETABLE ct, CACHETABLE_STATUS s) {
s->size_limit = ct->size_limit;
s->size_max = ct->size_max;
s->size_writing = ct->size_evicting;
s->get_and_pin_footprint = 0;
s->local_checkpoint = local_checkpoint;
s->local_checkpoint_files = local_checkpoint_files;
s->local_checkpoint_during_checkpoint = local_checkpoint_during_checkpoint;
s->evictions = cachetable_evictions;
s->cleaner_executions = cleaner_executions;
s->size_nonleaf = ct->size_nonleaf;
s->size_leaf = ct->size_leaf;
s->size_rollback = ct->size_rollback;
s->size_cachepressure = ct->size_cachepressure;
s->evictions = cachetable_evictions;
s->cleaner_executions = cleaner_executions;
}
char *
......
......@@ -503,20 +503,16 @@ typedef struct cachetable_status {
u_int64_t prefetches; // how many times has a block been prefetched into the cachetable?
u_int64_t maybe_get_and_pins; // how many times has maybe_get_and_pin(_clean) been called?
u_int64_t maybe_get_and_pin_hits; // how many times has maybe_get_and_pin(_clean) returned with a node?
int64_t size_current; // the sum of the sizes of the nodes represented in the cachetable
int64_t size_limit; // the limit to the sum of the node sizes
int64_t size_max; // high water mark of size_current (max value size_current ever had)
int64_t size_writing; // the sum of the sizes of the nodes being written
u_int64_t get_and_pin_footprint;
uint64_t local_checkpoint; // number of times a local checkpoint was taken for a commit (2440)
uint64_t local_checkpoint_files; // number of files subject to local checkpoint taken for a commit (2440)
uint64_t local_checkpoint_during_checkpoint; // number of times a local checkpoint happened during normal checkpoint (2440)
uint64_t size_current; // the sum of the sizes of the nodes represented in the cachetable
uint64_t size_limit; // the limit to the sum of the node sizes
uint64_t size_max; // high water mark of size_current (max value size_current ever had)
uint64_t size_writing; // the sum of the sizes of the nodes being written
uint64_t size_nonleaf; // number of bytes in cachetable belonging to nonleaf nodes
uint64_t size_leaf; // number of bytes in cachetable belonging to leaf nodes
uint64_t size_rollback; // number of bytes in cachetable belonging to rollback nodes
uint64_t size_cachepressure; // number of bytes causing cache pressure (sum of buffers and workdone counters)
u_int64_t evictions;
u_int64_t cleaner_executions; // number of times the cleaner thread's loop has executed
int64_t size_nonleaf; // number of bytes in cachetable belonging to nonleaf nodes
int64_t size_leaf; // number of bytes in cachetable belonging to leaf nodes
int64_t size_rollback; // number of bytes in cachetable belonging to rollback nodes
int64_t size_cachepressure; // number of bytes that cachetable thinks is causing cache pressure (sum of buffers, basically)
} CACHETABLE_STATUS_S, *CACHETABLE_STATUS;
void toku_cachetable_get_status(CACHETABLE ct, CACHETABLE_STATUS s);
......
......@@ -1980,15 +1980,12 @@ env_get_engine_status(DB_ENV * env, ENGINE_STATUS * engstat, char * env_panic_st
engstat->cachetable_size_limit = ctstat.size_limit;
engstat->cachetable_size_max = ctstat.size_max;
engstat->cachetable_size_writing = ctstat.size_writing;
engstat->get_and_pin_footprint = ctstat.get_and_pin_footprint;
engstat->local_checkpoint = ctstat.local_checkpoint;
engstat->local_checkpoint_files = ctstat.local_checkpoint_files;
engstat->local_checkpoint_during_checkpoint = ctstat.local_checkpoint_during_checkpoint;
engstat->cachetable_evictions = ctstat.evictions;
engstat->cleaner_executions = ctstat.cleaner_executions;
engstat->cachetable_size_leaf = ctstat.size_leaf;
engstat->cachetable_size_nonleaf = ctstat.size_nonleaf;
engstat->cachetable_size_leaf = ctstat.size_leaf;
engstat->cachetable_size_rollback = ctstat.size_rollback;
engstat->cachetable_size_cachepressure = ctstat.size_cachepressure;
engstat->cachetable_evictions = ctstat.evictions;
engstat->cleaner_executions = ctstat.cleaner_executions;
}
{
toku_ltm* ltm = env->i->ltm;
......@@ -2297,8 +2294,6 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) {
n += snprintf(buff + n, bufsiz - n, "cachetable_waittime %"PRIu64"\n", engstat.cachetable_waittime);
n += snprintf(buff + n, bufsiz - n, "cachetable_wait_reading %"PRIu64"\n", engstat.cachetable_wait_reading);
n += snprintf(buff + n, bufsiz - n, "cachetable_wait_writing %"PRIu64"\n", engstat.cachetable_wait_writing);
n += snprintf(buff + n, bufsiz - n, "cachetable_evictions %"PRIu64"\n", engstat.cachetable_evictions);
n += snprintf(buff + n, bufsiz - n, "cleaner_executions %"PRIu64"\n", engstat.cleaner_executions);
n += snprintf(buff + n, bufsiz - n, "puts %"PRIu64"\n", engstat.puts);
n += snprintf(buff + n, bufsiz - n, "prefetches %"PRIu64"\n", engstat.prefetches);
n += snprintf(buff + n, bufsiz - n, "maybe_get_and_pins %"PRIu64"\n", engstat.maybe_get_and_pins);
......@@ -2306,14 +2301,13 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) {
n += snprintf(buff + n, bufsiz - n, "cachetable_size_current %"PRId64"\n", engstat.cachetable_size_current);
n += snprintf(buff + n, bufsiz - n, "cachetable_size_limit %"PRId64"\n", engstat.cachetable_size_limit);
n += snprintf(buff + n, bufsiz - n, "cachetable_size_max %"PRId64"\n", engstat.cachetable_size_max);
n += snprintf(buff + n, bufsiz - n, "cachetable_size_leaf %"PRIu64"\n", engstat.cachetable_size_leaf);
n += snprintf(buff + n, bufsiz - n, "cachetable_size_writing %"PRId64"\n", engstat.cachetable_size_writing);
n += snprintf(buff + n, bufsiz - n, "cachetable_size_nonleaf %"PRIu64"\n", engstat.cachetable_size_nonleaf);
n += snprintf(buff + n, bufsiz - n, "cachetable_size_leaf %"PRIu64"\n", engstat.cachetable_size_leaf);
n += snprintf(buff + n, bufsiz - n, "cachetable_size_rollback %"PRIu64"\n", engstat.cachetable_size_rollback);
n += snprintf(buff + n, bufsiz - n, "cachetable_size_writing %"PRId64"\n", engstat.cachetable_size_writing);
n += snprintf(buff + n, bufsiz - n, "get_and_pin_footprint %"PRId64"\n", engstat.get_and_pin_footprint);
n += snprintf(buff + n, bufsiz - n, "local_checkpoint %"PRId64"\n", engstat.local_checkpoint);
n += snprintf(buff + n, bufsiz - n, "local_checkpoint_files %"PRId64"\n", engstat.local_checkpoint_files);
n += snprintf(buff + n, bufsiz - n, "local_checkpoint_during_checkpoint %"PRId64"\n", engstat.local_checkpoint_during_checkpoint);
n += snprintf(buff + n, bufsiz - n, "cachetable_evictions %"PRIu64"\n", engstat.cachetable_evictions);
n += snprintf(buff + n, bufsiz - n, "cleaner_executions %"PRIu64"\n", engstat.cleaner_executions);
n += snprintf(buff + n, bufsiz - n, "range_locks_max %"PRIu64"\n", engstat.range_locks_max);
n += snprintf(buff + n, bufsiz - n, "range_locks_curr %"PRIu64"\n", engstat.range_locks_curr);
n += snprintf(buff + n, bufsiz - n, "range_locks_max_memory %"PRIu64"\n", engstat.range_locks_max_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