Commit c83f8370 authored by Eugene Kosov's avatar Eugene Kosov Committed by Marko Mäkelä

MDEV-18214 remove some duplicated MONITOR counters

MONITOR_PENDING_LOG_WRITE
MONITOR_PENDING_CHECKPOINT_WRITE
MONITOR_LOG_IO: read values from log_t members instead of updating own
monitor variables
parent 8dc670a5
......@@ -193,9 +193,9 @@ log_lsn_checkpoint_age recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL
log_lsn_buf_pool_oldest recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value The oldest modified block LSN in the buffer pool
log_max_modified_age_async recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Maximum LSN difference; when exceeded, start asynchronous preflush
log_max_modified_age_sync recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Maximum LSN difference; when exceeded, start synchronous preflush
log_pending_log_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Pending log writes
log_pending_checkpoint_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Pending checkpoints
log_num_log_io recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of log I/Os
log_pending_log_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Pending log writes
log_pending_checkpoint_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Pending checkpoints
log_num_log_io recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled value Number of log I/Os
log_waits recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of log waits due to small log buffer (innodb_log_waits)
log_write_requests recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of log write requests (innodb_log_write_requests)
log_writes recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled status_counter Number of log writes (innodb_log_writes)
......
......@@ -1197,7 +1197,6 @@ log_io_complete(
group->n_pending_writes--;
log_sys->n_pending_writes--;
MONITOR_DEC(MONITOR_PENDING_LOG_WRITE);
unlock = log_group_check_flush_completion(group);
unlock = unlock | log_sys_check_flush_completion();
......@@ -1246,8 +1245,6 @@ log_group_file_header_flush(
if (log_do_write) {
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
srv_stats.os_log_pending_writes.inc();
fil_io(OS_FILE_WRITE | OS_FILE_LOG, true, group->space_id, 0,
......@@ -1373,8 +1370,6 @@ log_group_write_buf(
if (log_do_write) {
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
srv_stats.os_log_pending_writes.inc();
ut_a(next_offset / UNIV_PAGE_SIZE <= ULINT_MAX);
......@@ -1514,7 +1509,6 @@ log_write_up_to(
}
#endif /* UNIV_DEBUG */
log_sys->n_pending_writes++;
MONITOR_INC(MONITOR_PENDING_LOG_WRITE);
group = UT_LIST_GET_FIRST(log_sys->log_groups);
group->n_pending_writes++; /*!< We assume here that we have only
......@@ -1604,7 +1598,6 @@ log_write_up_to(
group->n_pending_writes--;
log_sys->n_pending_writes--;
MONITOR_DEC(MONITOR_PENDING_LOG_WRITE);
unlock = log_group_check_flush_completion(group);
unlock = unlock | log_sys_check_flush_completion();
......@@ -1788,7 +1781,6 @@ log_io_complete_checkpoint(void)
ut_ad(log_sys->n_pending_checkpoint_writes > 0);
log_sys->n_pending_checkpoint_writes--;
MONITOR_DEC(MONITOR_PENDING_CHECKPOINT_WRITE);
if (log_sys->n_pending_checkpoint_writes == 0) {
log_complete_checkpoint();
......@@ -1936,12 +1928,9 @@ log_group_checkpoint(
}
log_sys->n_pending_checkpoint_writes++;
MONITOR_INC(MONITOR_PENDING_CHECKPOINT_WRITE);
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
/* We send as the last parameter the group machine address
added with 1, as we want to distinguish between a normal log
file write and a checkpoint field write */
......@@ -2028,8 +2017,6 @@ log_group_read_checkpoint_info(
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
fil_io(OS_FILE_READ | OS_FILE_LOG, true, group->space_id, 0,
field / UNIV_PAGE_SIZE, field % UNIV_PAGE_SIZE,
OS_FILE_LOG_BLOCK_SIZE, log_sys->checkpoint_buf, NULL, 0);
......@@ -2325,8 +2312,6 @@ log_group_read_log_seg(
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
ut_a(source_offset / UNIV_PAGE_SIZE <= ULINT_MAX);
fil_io(OS_FILE_READ | OS_FILE_LOG, sync, group->space_id, 0,
......@@ -2417,8 +2402,6 @@ log_group_archive_file_header_write(
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
fil_io(OS_FILE_WRITE | OS_FILE_LOG, true, group->archive_space_id,
dest_offset / UNIV_PAGE_SIZE,
dest_offset % UNIV_PAGE_SIZE,
......@@ -2452,8 +2435,6 @@ log_group_archive_completed_header_write(
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
fil_io(OS_FILE_WRITE | OS_FILE_LOG, true, group->archive_space_id,
dest_offset / UNIV_PAGE_SIZE,
dest_offset % UNIV_PAGE_SIZE,
......@@ -2581,8 +2562,6 @@ log_group_archive(
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
//TODO (jonaso): This must be dead code??
log_encrypt_before_write(log_sys->next_checkpoint_no,
buf, start_lsn, len);
......
......@@ -873,15 +873,18 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_DEFAULT_START, MONITOR_OVLD_MAX_AGE_SYNC},
{"log_pending_log_writes", "recovery", "Pending log writes",
MONITOR_NONE,
static_cast<monitor_type_t>(
MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_PENDING_LOG_WRITE},
{"log_pending_checkpoint_writes", "recovery", "Pending checkpoints",
MONITOR_NONE,
static_cast<monitor_type_t>(
MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_PENDING_CHECKPOINT_WRITE},
{"log_num_log_io", "recovery", "Number of log I/Os",
MONITOR_NONE,
static_cast<monitor_type_t>(
MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_LOG_IO},
{"log_waits", "recovery",
......@@ -1970,6 +1973,25 @@ srv_mon_process_existing_counter(
value = (mon_type_t) log_sys->lsn;
break;
case MONITOR_PENDING_LOG_WRITE:
mutex_enter(&log_sys->mutex);
value = static_cast<mon_type_t>(log_sys->n_pending_writes);
mutex_exit(&log_sys->mutex);
break;
case MONITOR_PENDING_CHECKPOINT_WRITE:
mutex_enter(&log_sys->mutex);
value = static_cast<mon_type_t>(
log_sys->n_pending_checkpoint_writes);
mutex_exit(&log_sys->mutex);
break;
case MONITOR_LOG_IO:
mutex_enter(&log_sys->mutex);
value = static_cast<mon_type_t>(log_sys->n_log_ios);
mutex_exit(&log_sys->mutex);
break;
case MONITOR_OVLD_BUF_OLDEST_LSN:
value = (mon_type_t) buf_pool_get_oldest_modification();
break;
......
......@@ -1305,7 +1305,6 @@ log_io_complete(
group->n_pending_writes--;
log_sys->n_pending_writes--;
MONITOR_DEC(MONITOR_PENDING_LOG_WRITE);
unlock = log_group_check_flush_completion(group);
unlock = unlock | log_sys_check_flush_completion();
......@@ -1357,8 +1356,6 @@ log_group_file_header_flush(
if (log_do_write) {
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
srv_stats.os_log_pending_writes.inc();
fil_io(OS_FILE_WRITE | OS_FILE_LOG, true, group->space_id, 0,
......@@ -1483,8 +1480,6 @@ log_group_write_buf(
if (log_do_write) {
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
srv_stats.os_log_pending_writes.inc();
ut_a(next_offset / UNIV_PAGE_SIZE <= ULINT_MAX);
......@@ -1632,7 +1627,6 @@ log_write_up_to(
}
#endif /* UNIV_DEBUG */
log_sys->n_pending_writes++;
MONITOR_INC(MONITOR_PENDING_LOG_WRITE);
group = UT_LIST_GET_FIRST(log_sys->log_groups);
group->n_pending_writes++; /*!< We assume here that we have only
......@@ -1724,7 +1718,6 @@ log_write_up_to(
group->n_pending_writes--;
log_sys->n_pending_writes--;
MONITOR_DEC(MONITOR_PENDING_LOG_WRITE);
unlock = log_group_check_flush_completion(group);
unlock = unlock | log_sys_check_flush_completion();
......@@ -1939,7 +1932,6 @@ log_io_complete_checkpoint(void)
ut_ad(log_sys->n_pending_checkpoint_writes > 0);
log_sys->n_pending_checkpoint_writes--;
MONITOR_DEC(MONITOR_PENDING_CHECKPOINT_WRITE);
if (log_sys->n_pending_checkpoint_writes == 0) {
log_complete_checkpoint();
......@@ -2086,12 +2078,9 @@ log_group_checkpoint(
}
log_sys->n_pending_checkpoint_writes++;
MONITOR_INC(MONITOR_PENDING_CHECKPOINT_WRITE);
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
/* We send as the last parameter the group machine address
added with 1, as we want to distinguish between a normal log
file write and a checkpoint field write */
......@@ -2178,8 +2167,6 @@ log_group_read_checkpoint_info(
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
fil_io(OS_FILE_READ | OS_FILE_LOG, true, group->space_id, 0,
field / UNIV_PAGE_SIZE, field % UNIV_PAGE_SIZE,
OS_FILE_LOG_BLOCK_SIZE, log_sys->checkpoint_buf, NULL, 0);
......@@ -2564,8 +2551,6 @@ log_group_read_log_seg(
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
ut_a(source_offset / UNIV_PAGE_SIZE <= ULINT_MAX);
if (release_mutex) {
......@@ -2727,8 +2712,6 @@ log_group_archive_file_header_write(
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
fil_io(OS_FILE_WRITE | OS_FILE_LOG, true, group->archive_space_id,
0,
dest_offset / UNIV_PAGE_SIZE,
......@@ -2763,8 +2746,6 @@ log_group_archive_completed_header_write(
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
fil_io(OS_FILE_WRITE | OS_FILE_LOG, true, group->archive_space_id,
0,
dest_offset / UNIV_PAGE_SIZE,
......@@ -2895,8 +2876,6 @@ log_group_archive(
log_sys->n_log_ios++;
MONITOR_INC(MONITOR_LOG_IO);
//TODO (jonaso): This must be dead code??
log_encrypt_before_write(log_sys->next_checkpoint_no,
buf, start_lsn, len);
......
......@@ -873,15 +873,18 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_DEFAULT_START, MONITOR_OVLD_MAX_AGE_SYNC},
{"log_pending_log_writes", "recovery", "Pending log writes",
MONITOR_NONE,
static_cast<monitor_type_t>(
MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_PENDING_LOG_WRITE},
{"log_pending_checkpoint_writes", "recovery", "Pending checkpoints",
MONITOR_NONE,
static_cast<monitor_type_t>(
MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_PENDING_CHECKPOINT_WRITE},
{"log_num_log_io", "recovery", "Number of log I/Os",
MONITOR_NONE,
static_cast<monitor_type_t>(
MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_LOG_IO},
{"log_waits", "recovery",
......@@ -1970,6 +1973,25 @@ srv_mon_process_existing_counter(
value = (mon_type_t) log_sys->lsn;
break;
case MONITOR_PENDING_LOG_WRITE:
mutex_enter(&log_sys->mutex);
value = static_cast<mon_type_t>(log_sys->n_pending_writes);
mutex_exit(&log_sys->mutex);
break;
case MONITOR_PENDING_CHECKPOINT_WRITE:
mutex_enter(&log_sys->mutex);
value = static_cast<mon_type_t>(
log_sys->n_pending_checkpoint_writes);
mutex_exit(&log_sys->mutex);
break;
case MONITOR_LOG_IO:
mutex_enter(&log_sys->mutex);
value = static_cast<mon_type_t>(log_sys->n_log_ios);
mutex_exit(&log_sys->mutex);
break;
case MONITOR_OVLD_BUF_OLDEST_LSN:
value = (mon_type_t) buf_pool_get_oldest_modification();
break;
......
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