Skip to content

Commit 4f4373f

Browse files
committed
Add eviction count for table cache lru cleanup (innobase)
This is a port of dveeden's work: dveeden/mysql-server@e9d00e8 (Mostly changes in linenumbers, a bit of whitespace fix-up.)
1 parent cf154cc commit 4f4373f

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

storage/innobase/include/srv0mon.h

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

storage/innobase/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/innobase/srv/srv0srv.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2274,6 +2274,7 @@ srv_master_do_active_tasks(void)
22742274
{
22752275
ib_time_t cur_time = ut_time();
22762276
ullint counter_time = ut_time_us(NULL);
2277+
ulint n_evicted = 0;
22772278

22782279
/* First do the tasks that we are suppose to do at each
22792280
invocation of this function. */
@@ -2334,7 +2335,9 @@ srv_master_do_active_tasks(void)
23342335

23352336
if (cur_time % SRV_MASTER_DICT_LRU_INTERVAL == 0) {
23362337
srv_main_thread_op_info = "enforcing dict cache limit";
2337-
srv_master_evict_from_table_cache(50);
2338+
n_evicted = srv_master_evict_from_table_cache(50);
2339+
MONITOR_INC_VALUE(
2340+
MONITOR_SRV_DICT_LRU_EVICT_COUNT, n_evicted);
23382341
MONITOR_INC_TIME_IN_MICRO_SECS(
23392342
MONITOR_SRV_DICT_LRU_MICROSECOND, counter_time);
23402343
}

0 commit comments

Comments
 (0)