Commit 9e488653 authored by Marko Mäkelä's avatar Marko Mäkelä

Cleanup: Make MONITOR_LSN_CHECKPOINT_AGE a value.

Compute MONITOR_LSN_CHECKPOINT_AGE on demand in
srv_mon_process_existing_counter().
This allows us to remove the overhead of MONITOR_SET
calls for the counter.
parent 4383897a
......@@ -198,7 +198,7 @@ log_checkpoints recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0
log_lsn_last_flush recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value LSN of Last flush
log_lsn_last_checkpoint recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value LSN at last checkpoint
log_lsn_current recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Current LSN value
log_lsn_checkpoint_age recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Current LSN value minus LSN at last checkpoint
log_lsn_checkpoint_age recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Current LSN value minus LSN at last checkpoint
log_lsn_buf_pool_oldest recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 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 0 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 0 value Maximum LSN difference; when exceeded, start synchronous preflush
......
......@@ -312,9 +312,6 @@ log_reserve_and_write_fast(
log_sys.lsn += len;
MONITOR_SET(MONITOR_LSN_CHECKPOINT_AGE,
log_sys.lsn - log_sys.last_checkpoint_lsn);
return(log_sys.lsn);
}
......
......@@ -554,8 +554,6 @@ void log_t::create()
buf_free= LOG_BLOCK_HDR_SIZE;
lsn= LOG_START_LSN + LOG_BLOCK_HDR_SIZE;
MONITOR_SET(MONITOR_LSN_CHECKPOINT_AGE, lsn - last_checkpoint_lsn);
log_scrub_thread_active= !srv_read_only_mode && srv_scrub_log;
if (log_scrub_thread_active) {
log_scrub_event= os_event_create("log_scrub_event");
......@@ -1405,8 +1403,6 @@ void log_write_checkpoint_info(lsn_t end_lsn)
log_sys.next_checkpoint_no++;
log_sys.last_checkpoint_lsn = log_sys.next_checkpoint_lsn;
MONITOR_SET(MONITOR_LSN_CHECKPOINT_AGE,
log_sys.lsn - log_sys.last_checkpoint_lsn);
DBUG_PRINT("ib_log", ("checkpoint ended at " LSN_PF
", flushed to " LSN_PF,
......
......@@ -3553,9 +3553,6 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
fil_names_clear(log_sys.last_checkpoint_lsn, true);
}
MONITOR_SET(MONITOR_LSN_CHECKPOINT_AGE,
log_sys.lsn - log_sys.last_checkpoint_lsn);
log_sys.next_checkpoint_no = ++checkpoint_no;
mutex_enter(&recv_sys.mutex);
......
......@@ -889,7 +889,8 @@ static monitor_info_t innodb_counter_info[] =
{"log_lsn_checkpoint_age", "recovery",
"Current LSN value minus LSN at last checkpoint",
MONITOR_NONE,
static_cast<monitor_type_t>(
MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_LSN_CHECKPOINT_AGE},
{"log_lsn_buf_pool_oldest", "recovery",
......@@ -1993,6 +1994,13 @@ srv_mon_process_existing_counter(
mutex_exit(&log_sys.mutex);
break;
case MONITOR_LSN_CHECKPOINT_AGE:
mutex_enter(&log_sys.mutex);
value = static_cast<mon_type_t>(log_sys.lsn
- log_sys.last_checkpoint_lsn);
mutex_exit(&log_sys.mutex);
break;
case MONITOR_OVLD_BUF_OLDEST_LSN:
value = (mon_type_t) buf_pool_get_oldest_modification();
break;
......
......@@ -341,8 +341,6 @@ static dberr_t create_log_file(lsn_t lsn, std::string& logfile0)
log_sys.buf_free = LOG_BLOCK_HDR_SIZE;
log_sys.lsn += LOG_BLOCK_HDR_SIZE;
MONITOR_SET(MONITOR_LSN_CHECKPOINT_AGE,
(log_sys.lsn - log_sys.last_checkpoint_lsn));
log_mutex_exit();
log_make_checkpoint();
......
......@@ -180,7 +180,7 @@ log_checkpoints recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0
log_lsn_last_flush recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value LSN of Last flush
log_lsn_last_checkpoint recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value LSN at last checkpoint
log_lsn_current recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Current LSN value
log_lsn_checkpoint_age recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Current LSN value minus LSN at last checkpoint
log_lsn_checkpoint_age recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Current LSN value minus LSN at last checkpoint
log_lsn_buf_pool_oldest recovery 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 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 0 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 0 value Maximum LSN difference; when exceeded, start synchronous preflush
......
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