Commit 8e833273 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Merge in all the changes from 18354 to 18555 from 3.1.0. The only real change...

Merge in all the changes from 18354 to 18555 from 3.1.0.  The only real change was in the engine status instrumentation.  Refs #2467. [t:2467].
{{{
svn merge -r18354:18555 https://svn.tokutek.com/tokudb/mysql.branches/3.1.0/tokudb/
}}}
.


git-svn-id: file:///svn/toku/tokudb@18657 c7de825b-a66e-492c-adef-691d508d4ae1
parent 91d93e80
......@@ -459,6 +459,13 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__
printf(" u_int64_t sequential_queries; /* ydb sequential queries */ \n");
printf(" u_int64_t fsync_count; /* number of times fsync performed */ \n");
printf(" u_int64_t fsync_time; /* total time required to fsync */ \n");
printf(" u_int64_t logger_ilock_ctr; /* how many times has logger input lock been taken or released */ \n");
printf(" u_int64_t logger_olock_ctr; /* how many times has logger output condition lock been taken or released */ \n");
printf(" u_int64_t logger_swap_ctr; /* how many times have logger buffers been swapped */ \n");
printf(" char enospc_most_recent[26]; /* time of most recent ENOSPC error return from disk write */ \n");
printf(" u_int64_t enospc_threads_blocked; /* how many threads are currently blocked by ENOSPC */ \n");
printf(" u_int64_t enospc_total; /* how many times has ENOSPC been returned by disk write */ \n");
printf("} ENGINE_STATUS;\n");
print_dbtype();
......
......@@ -107,6 +107,9 @@ typedef struct __toku_engine_status {
u_int64_t logger_ilock_ctr; /* how many times has logger input lock been taken or released */
u_int64_t logger_olock_ctr; /* how many times has logger output condition lock been taken or released */
u_int64_t logger_swap_ctr; /* how many times have logger buffers been swapped */
char enospc_most_recent[26]; /* time of most recent ENOSPC error return from disk write */
u_int64_t enospc_threads_blocked; /* how many threads are currently blocked by ENOSPC */
u_int64_t enospc_total; /* how many times has ENOSPC been returned by disk write */
} ENGINE_STATUS;
typedef enum {
DB_BTREE=1,
......
......@@ -213,6 +213,12 @@ static uint64_t get_tnow(void) {
return tv.tv_sec * 1000000ULL + tv.tv_usec;
}
static uint64_t get_tnow(void) {
struct timeval tv;
int r = gettimeofday(&tv, NULL); assert(r == 0);
return tv.tv_sec * 1000000ULL + tv.tv_usec;
}
// keep trying if fsync fails because of EINTR
int
toku_file_fsync(int fd) {
......
......@@ -1396,6 +1396,14 @@ env_get_engine_status(DB_ENV * env, ENGINE_STATUS * engstat) {
engstat->logger_olock_ctr = log_stat.olock_ctr;
engstat->logger_swap_ctr = log_stat.swap_ctr;
}
{
time_t enospc_most_recent_timestamp;
u_int64_t enospc_threads_blocked, enospc_total;
toku_fs_get_write_info(&enospc_most_recent_timestamp, &enospc_threads_blocked, &enospc_total);
format_time(&enospc_most_recent_timestamp, engstat->enospc_most_recent);
engstat->enospc_threads_blocked = enospc_threads_blocked;
engstat->enospc_total = enospc_total;
}
}
return r;
......@@ -1455,6 +1463,12 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) {
n += snprintf(buff + n, bufsiz - n, "sequential_queries %"PRIu64"\n", engstat.sequential_queries);
n += snprintf(buff + n, bufsiz - n, "fsync_count %"PRIu64"\n", engstat.fsync_count);
n += snprintf(buff + n, bufsiz - n, "fsync_time %"PRIu64"\n", engstat.fsync_time);
n += snprintf(buff + n, bufsiz - n, "logger ilock count %"PRIu64"\n", engstat.logger_ilock_ctr);
n += snprintf(buff + n, bufsiz - n, "logger olock count %"PRIu64"\n", engstat.logger_olock_ctr);
n += snprintf(buff + n, bufsiz - n, "logger swap count %"PRIu64"\n", engstat.logger_swap_ctr);
n += snprintf(buff + n, bufsiz - n, "enospc_most_recent %s \n", engstat.enospc_most_recent);
n += snprintf(buff + n, bufsiz - n, "enospc threads blocked %"PRIu64"\n", engstat.enospc_threads_blocked);
n += snprintf(buff + n, bufsiz - n, "enospc total %"PRIu64"\n", engstat.enospc_total);
if (n > bufsiz) {
char * errmsg = "BUFFER TOO SMALL\n";
......
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