Skip to content

Commit df32920

Browse files
committed
Add eviction count for table cache lru cleanup (xtradb)
1 parent 4f4373f commit df32920

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

storage/xtradb/include/srv0mon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ enum monitor_id_t {
379379
MONITOR_SRV_MEM_VALIDATE_MICROSECOND,
380380
MONITOR_SRV_PURGE_MICROSECOND,
381381
MONITOR_SRV_DICT_LRU_MICROSECOND,
382+
MONITOR_SRV_DICT_LRU_EVICT_COUNT,
382383
MONITOR_SRV_CHECKPOINT_MICROSECOND,
383384
MONITOR_OVLD_SRV_DBLWR_WRITES,
384385
MONITOR_OVLD_SRV_DBLWR_PAGES_WRITTEN,

storage/xtradb/srv/srv0mon.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,11 @@ static monitor_info_t innodb_counter_info[] =
11961196
MONITOR_NONE,
11971197
MONITOR_DEFAULT_START, MONITOR_SRV_DICT_LRU_MICROSECOND},
11981198

1199+
{"innodb_dict_lru_count", "server",
1200+
"Number of tables evicted from DICT LRU list",
1201+
MONITOR_NONE,
1202+
MONITOR_DEFAULT_START, MONITOR_SRV_DICT_LRU_EVICT_COUNT},
1203+
11991204
{"innodb_checkpoint_usec", "server",
12001205
"Time (in microseconds) spent by master thread to do checkpoint",
12011206
MONITOR_NONE,

storage/xtradb/srv/srv0srv.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2881,6 +2881,7 @@ srv_master_do_active_tasks(void)
28812881
{
28822882
ib_time_t cur_time = ut_time();
28832883
ullint counter_time = ut_time_us(NULL);
2884+
ulint n_evicted = 0;
28842885

28852886
/* First do the tasks that we are suppose to do at each
28862887
invocation of this function. */
@@ -2941,7 +2942,9 @@ srv_master_do_active_tasks(void)
29412942

29422943
if (cur_time % SRV_MASTER_DICT_LRU_INTERVAL == 0) {
29432944
srv_main_thread_op_info = "enforcing dict cache limit";
2944-
srv_master_evict_from_table_cache(50);
2945+
n_evicted = srv_master_evict_from_table_cache(50);
2946+
MONITOR_INC_VALUE(
2947+
MONITOR_SRV_DICT_LRU_EVICT_COUNT, n_evicted);
29452948
MONITOR_INC_TIME_IN_MICRO_SECS(
29462949
MONITOR_SRV_DICT_LRU_MICROSECOND, counter_time);
29472950
}

0 commit comments

Comments
 (0)