Commit 4d9335d2 authored by John Esmet's avatar John Esmet

fixes #152 Add accounting for long input buffer wait stalls in the

logger
parent 42824104
...@@ -177,6 +177,7 @@ struct tokulogger { ...@@ -177,6 +177,7 @@ struct tokulogger {
uint64_t num_writes_to_disk; // how many times did we write to disk? uint64_t num_writes_to_disk; // how many times did we write to disk?
uint64_t bytes_written_to_disk; // how many bytes have been written to disk? uint64_t bytes_written_to_disk; // how many bytes have been written to disk?
tokutime_t time_spent_writing_to_disk; // how much tokutime did we spend writing to disk? tokutime_t time_spent_writing_to_disk; // how much tokutime did we spend writing to disk?
uint64_t num_wait_buf_long; // how many times we waited >= 100ms for the in buf
void (*remove_finalize_callback) (DICTIONARY_ID, void*); // ydb-level callback to be called when a transaction that ... void (*remove_finalize_callback) (DICTIONARY_ID, void*); // ydb-level callback to be called when a transaction that ...
void * remove_finalize_callback_extra; // ... deletes a file is committed or when one that creates a file is aborted. void * remove_finalize_callback_extra; // ... deletes a file is committed or when one that creates a file is aborted.
......
...@@ -422,9 +422,13 @@ wait_till_output_available (TOKULOGGER logger) ...@@ -422,9 +422,13 @@ wait_till_output_available (TOKULOGGER logger)
// Exit: Holds the output_condition_lock and logger->output_is_available // Exit: Holds the output_condition_lock and logger->output_is_available
// //
{ {
tokutime_t t0 = toku_time_now();
while (!logger->output_is_available) { while (!logger->output_is_available) {
toku_cond_wait(&logger->output_condition, &logger->output_condition_lock); toku_cond_wait(&logger->output_condition, &logger->output_condition_lock);
} }
if (tokutime_to_seconds(toku_time_now() - t0) >= 0.100) {
logger->num_wait_buf_long++;
}
} }
static void static void
...@@ -1397,6 +1401,7 @@ status_init(void) { ...@@ -1397,6 +1401,7 @@ status_init(void) {
STATUS_INIT(LOGGER_BYTES_WRITTEN, LOGGER_WRITES_BYTES, UINT64, "writes (bytes)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(LOGGER_BYTES_WRITTEN, LOGGER_WRITES_BYTES, UINT64, "writes (bytes)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(LOGGER_UNCOMPRESSED_BYTES_WRITTEN, LOGGER_WRITES_UNCOMPRESSED_BYTES, UINT64, "writes (uncompressed bytes)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(LOGGER_UNCOMPRESSED_BYTES_WRITTEN, LOGGER_WRITES_UNCOMPRESSED_BYTES, UINT64, "writes (uncompressed bytes)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(LOGGER_TOKUTIME_WRITES, LOGGER_WRITES_SECONDS, TOKUTIME, "writes (seconds)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS); STATUS_INIT(LOGGER_TOKUTIME_WRITES, LOGGER_WRITES_SECONDS, TOKUTIME, "writes (seconds)", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
STATUS_INIT(LOGGER_WAIT_BUF_LONG, LOGGER_WAIT_LONG, UINT64, "count", TOKU_ENGINE_STATUS|TOKU_GLOBAL_STATUS);
logger_status.initialized = true; logger_status.initialized = true;
} }
#undef STATUS_INIT #undef STATUS_INIT
...@@ -1414,6 +1419,7 @@ toku_logger_get_status(TOKULOGGER logger, LOGGER_STATUS statp) { ...@@ -1414,6 +1419,7 @@ toku_logger_get_status(TOKULOGGER logger, LOGGER_STATUS statp) {
// No compression on logfiles so the uncompressed size is just number of bytes written // No compression on logfiles so the uncompressed size is just number of bytes written
STATUS_VALUE(LOGGER_UNCOMPRESSED_BYTES_WRITTEN) = logger->bytes_written_to_disk; STATUS_VALUE(LOGGER_UNCOMPRESSED_BYTES_WRITTEN) = logger->bytes_written_to_disk;
STATUS_VALUE(LOGGER_TOKUTIME_WRITES) = logger->time_spent_writing_to_disk; STATUS_VALUE(LOGGER_TOKUTIME_WRITES) = logger->time_spent_writing_to_disk;
STATUS_VALUE(LOGGER_WAIT_BUF_LONG) = logger->num_wait_buf_long;
} }
*statp = logger_status; *statp = logger_status;
} }
......
...@@ -244,6 +244,7 @@ typedef enum { ...@@ -244,6 +244,7 @@ typedef enum {
LOGGER_BYTES_WRITTEN, LOGGER_BYTES_WRITTEN,
LOGGER_UNCOMPRESSED_BYTES_WRITTEN, LOGGER_UNCOMPRESSED_BYTES_WRITTEN,
LOGGER_TOKUTIME_WRITES, LOGGER_TOKUTIME_WRITES,
LOGGER_WAIT_BUF_LONG,
LOGGER_STATUS_NUM_ROWS LOGGER_STATUS_NUM_ROWS
} logger_status_entry; } logger_status_entry;
......
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