Debian Codegraph @

storage/innobase/srv/srv0mon.cc

raw symbols SCIP
1 /*****************************************************************************
2
3 Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved.
4 Copyright (c) 2012, Facebook Inc.
5 Copyright (c) 2013, 2023, MariaDB Corporation.
6
7 This program is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free Software
9 Foundation; version 2 of the License.
10
11 This program is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along with
16 this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
18
19 *****************************************************************************/
20
21 /**************************************************//**
22 @file srv/srv0mon.cc
23 Database monitor counter interfaces
24
25 Created 12/9/2009 Jimmy Yang
26 *******************************************************/
27
28 #include "buf0flu.h"cxx . . $ `<file>/storage/innobase/include/buf0flu.h`/
29 #include "dict0mem.h"cxx . . $ `<file>/storage/innobase/include/dict0mem.h`/
30 #include "lock0lock.h"cxx . . $ `<file>/storage/innobase/include/lock0lock.h`/
31 #include "mach0data.h"cxx . . $ `<file>/storage/innobase/include/mach0data.h`/
32 #include "os0file.h"cxx . . $ `<file>/storage/innobase/include/os0file.h`/
33 #include "srv0mon.h"cxx . . $ `<file>/storage/innobase/include/srv0mon.h`/
34 #include "srv0srv.h"cxx . . $ `<file>/storage/innobase/include/srv0srv.h`/
35 #include "trx0rseg.h"cxx . . $ `<file>/storage/innobase/include/trx0rseg.h`/
36 #include "trx0sys.h"cxx . . $ `<file>/storage/innobase/include/trx0sys.h`/
37 #include "log.h"cxx . . $ `<file>/sql/log.h`/
38
39 /* Macro to standardize the counter names for counters in the
40 "monitor_buf_page" module as they have very structured defines */
41 #define MONITOR_BUF_PAGEcxx . . $ `storage/innobase/srv/srv0mon.cc:41:9`!(name, description, code, op, op_code) \
42 {"buffer_page_" op "_" name, "buffer_page_io", \
43 "Number of " description " Pages " op, \
44 MONITOR_GROUP_MODULE, MONITOR_DEFAULT_START, \
45 MONITOR_##code##_##op_code}
46
47 #define MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!(name, description, code) \
48 MONITOR_BUF_PAGEcxx . . $ `storage/innobase/srv/srv0mon.cc:41:9`!(name, description, code, "read", PAGE_READ)
49
50 #define MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!(name, description, code) \
51 MONITOR_BUF_PAGEcxx . . $ `storage/innobase/srv/srv0mon.cc:41:9`!(name, description, code, "written", PAGE_WRITTEN)
52
53 /** This array defines basic static information of monitor counters,
54 including each monitor's name, module it belongs to, a short
55 description and its property/type and corresponding monitor_id.
56 Please note: If you add a monitor here, please add its corresponding
57 monitor_id to "enum monitor_id_value" structure in srv0mon.h file. */
58
59 static monitor_info_tcxx . . $ monitor_info_t# innodb_counter_infocxx . . $ innodb_counter_info.[] =
60 {
61 /* A dummy item to mark the module start, this is
62 to accomodate the default value (0) set for the
63 global variables with the control system. */
64 {"module_start", "module_start", "module_start",
65 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
66 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START.},
67
68 /* ========== Counters for Server Metadata ========== */
69 {"module_metadata", "metadata", "Server Metadata",
70 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
71 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_METADATAcxx . . $ MONITOR_MODULE_METADATA.},
72
73 {"metadata_table_handles_opened", "metadata",
74 "Number of table handles opened",
75 MONITOR_NONEcxx . . $ MONITOR_NONE.,
76 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_TABLE_OPENcxx . . $ MONITOR_TABLE_OPEN.},
77
78 /* ========== Counters for Lock Module ========== */
79 {"module_lock", "lock", "Lock Module",
80 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
81 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_LOCKcxx . . $ MONITOR_MODULE_LOCK.},
82
83 {"lock_deadlocks", "lock", "Number of deadlocks",
84 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
85 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
86 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_DEADLOCKcxx . . $ MONITOR_DEADLOCK.},
87
88 {"lock_timeouts", "lock", "Number of lock timeouts",
89 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
90 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
91 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_TIMEOUTcxx . . $ MONITOR_TIMEOUT.},
92
93 {"lock_rec_lock_waits", "lock",
94 "Number of times enqueued into record lock wait queue",
95 MONITOR_NONEcxx . . $ MONITOR_NONE.,
96 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_LOCKREC_WAITcxx . . $ MONITOR_LOCKREC_WAIT.},
97
98 {"lock_table_lock_waits", "lock",
99 "Number of times enqueued into table lock wait queue",
100 MONITOR_NONEcxx . . $ MONITOR_NONE.,
101 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_TABLELOCK_WAITcxx . . $ MONITOR_TABLELOCK_WAIT.},
102
103 {"lock_rec_lock_requests", "lock",
104 "Number of record locks requested",
105 MONITOR_NONEcxx . . $ MONITOR_NONE.,
106 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_NUM_RECLOCK_REQcxx . . $ MONITOR_NUM_RECLOCK_REQ.},
107
108 {"lock_rec_lock_created", "lock", "Number of record locks created",
109 MONITOR_NONEcxx . . $ MONITOR_NONE.,
110 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_RECLOCK_CREATEDcxx . . $ MONITOR_RECLOCK_CREATED.},
111
112 {"lock_rec_lock_removed", "lock",
113 "Number of record locks removed from the lock queue",
114 MONITOR_NONEcxx . . $ MONITOR_NONE.,
115 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_RECLOCK_REMOVEDcxx . . $ MONITOR_RECLOCK_REMOVED.},
116
117 {"lock_rec_locks", "lock",
118 "Current number of record locks on tables",
119 MONITOR_NONEcxx . . $ MONITOR_NONE.,
120 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_NUM_RECLOCKcxx . . $ MONITOR_NUM_RECLOCK.},
121
122 {"lock_table_lock_created", "lock", "Number of table locks created",
123 MONITOR_NONEcxx . . $ MONITOR_NONE.,
124 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_TABLELOCK_CREATEDcxx . . $ MONITOR_TABLELOCK_CREATED.},
125
126 {"lock_table_lock_removed", "lock",
127 "Number of table locks removed from the lock queue",
128 MONITOR_NONEcxx . . $ MONITOR_NONE.,
129 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_TABLELOCK_REMOVEDcxx . . $ MONITOR_TABLELOCK_REMOVED.},
130
131 {"lock_table_locks", "lock",
132 "Current number of table locks on tables",
133 MONITOR_NONEcxx . . $ MONITOR_NONE.,
134 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_NUM_TABLELOCKcxx . . $ MONITOR_NUM_TABLELOCK.},
135
136 {"lock_row_lock_current_waits", "lock",
137 "Number of row locks currently being waited for"
138 " (innodb_row_lock_current_waits)",
139 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
140 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
141 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_ROW_LOCK_CURRENT_WAITcxx . . $ MONITOR_OVLD_ROW_LOCK_CURRENT_WAIT.},
142
143 {"lock_row_lock_time", "lock",
144 "Time spent in acquiring row locks, in milliseconds"
145 " (innodb_row_lock_time)",
146 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
147 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
148 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_LOCK_WAIT_TIMEcxx . . $ MONITOR_OVLD_LOCK_WAIT_TIME.},
149
150 {"lock_row_lock_time_max", "lock",
151 "The maximum time to acquire a row lock, in milliseconds"
152 " (innodb_row_lock_time_max)",
153 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
154 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
155 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_LOCK_MAX_WAIT_TIMEcxx . . $ MONITOR_OVLD_LOCK_MAX_WAIT_TIME.},
156
157 {"lock_row_lock_waits", "lock",
158 "Number of times a row lock had to be waited for"
159 " (innodb_row_lock_waits)",
160 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
161 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
162 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_ROW_LOCK_WAITcxx . . $ MONITOR_OVLD_ROW_LOCK_WAIT.},
163
164 {"lock_row_lock_time_avg", "lock",
165 "The average time to acquire a row lock, in milliseconds"
166 " (innodb_row_lock_time_avg)",
167 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
168 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
169 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_LOCK_AVG_WAIT_TIMEcxx . . $ MONITOR_OVLD_LOCK_AVG_WAIT_TIME.},
170
171 /* ========== Counters for Buffer Manager and I/O ========== */
172 {"module_buffer", "buffer", "Buffer Manager Module",
173 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
174 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_BUFFERcxx . . $ MONITOR_MODULE_BUFFER.},
175
176 {"buffer_pool_size", "server",
177 "Server buffer pool size (all buffer pools) in bytes",
178 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
179 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
180 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUFFER_POOL_SIZEcxx . . $ MONITOR_OVLD_BUFFER_POOL_SIZE.},
181
182 {"buffer_pool_reads", "buffer",
183 "Number of reads directly from disk (innodb_buffer_pool_reads)",
184 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
185 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
186 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_READScxx . . $ MONITOR_OVLD_BUF_POOL_READS.},
187
188 {"buffer_pool_read_requests", "buffer",
189 "Number of logical read requests (innodb_buffer_pool_read_requests)",
190 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
191 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
192 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_READ_REQUESTScxx . . $ MONITOR_OVLD_BUF_POOL_READ_REQUESTS.},
193
194 {"buffer_pool_write_requests", "buffer",
195 "Number of write requests (innodb_buffer_pool_write_requests)",
196 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
197 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
198 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_WRITE_REQUESTcxx . . $ MONITOR_OVLD_BUF_POOL_WRITE_REQUEST.},
199
200 {"buffer_pool_wait_free", "buffer",
201 "Number of times waited for free buffer"
202 " (innodb_buffer_pool_wait_free)",
203 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
204 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
205 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_WAIT_FREEcxx . . $ MONITOR_OVLD_BUF_POOL_WAIT_FREE.},
206
207 {"buffer_pool_read_ahead", "buffer",
208 "Number of pages read as read ahead (innodb_buffer_pool_read_ahead)",
209 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
210 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
211 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_READ_AHEADcxx . . $ MONITOR_OVLD_BUF_POOL_READ_AHEAD.},
212
213 {"buffer_pool_read_ahead_evicted", "buffer",
214 "Read-ahead pages evicted without being accessed"
215 " (innodb_buffer_pool_read_ahead_evicted)",
216 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
217 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
218 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_READ_AHEAD_EVICTEDcxx . . $ MONITOR_OVLD_BUF_POOL_READ_AHEAD_EVICTED.},
219
220 {"buffer_pool_pages_total", "buffer",
221 "Total buffer pool size in pages (innodb_buffer_pool_pages_total)",
222 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
223 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
224 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_PAGE_TOTALcxx . . $ MONITOR_OVLD_BUF_POOL_PAGE_TOTAL.},
225
226 {"buffer_pool_pages_misc", "buffer",
227 "Buffer pages for misc use such as row locks or the adaptive"
228 " hash index (innodb_buffer_pool_pages_misc)",
229 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
230 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
231 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_PAGE_MISCcxx . . $ MONITOR_OVLD_BUF_POOL_PAGE_MISC.},
232
233 {"buffer_pool_pages_data", "buffer",
234 "Buffer pages containing data (innodb_buffer_pool_pages_data)",
235 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
236 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
237 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_PAGES_DATAcxx . . $ MONITOR_OVLD_BUF_POOL_PAGES_DATA.},
238
239 {"buffer_pool_bytes_data", "buffer",
240 "Buffer bytes containing data (innodb_buffer_pool_bytes_data)",
241 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
242 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
243 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_BYTES_DATAcxx . . $ MONITOR_OVLD_BUF_POOL_BYTES_DATA.},
244
245 {"buffer_pool_pages_dirty", "buffer",
246 "Buffer pages currently dirty (innodb_buffer_pool_pages_dirty)",
247 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
248 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
249 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_PAGES_DIRTYcxx . . $ MONITOR_OVLD_BUF_POOL_PAGES_DIRTY.},
250
251 {"buffer_pool_bytes_dirty", "buffer",
252 "Buffer bytes currently dirty (innodb_buffer_pool_bytes_dirty)",
253 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
254 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
255 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_BYTES_DIRTYcxx . . $ MONITOR_OVLD_BUF_POOL_BYTES_DIRTY.},
256
257 {"buffer_pool_pages_free", "buffer",
258 "Buffer pages currently free (innodb_buffer_pool_pages_free)",
259 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
260 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
261 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_POOL_PAGES_FREEcxx . . $ MONITOR_OVLD_BUF_POOL_PAGES_FREE.},
262
263 {"buffer_pages_created", "buffer",
264 "Number of pages created (innodb_pages_created)",
265 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
266 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
267 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_PAGE_CREATEDcxx . . $ MONITOR_OVLD_PAGE_CREATED.},
268
269 {"buffer_pages_written", "buffer",
270 "Number of pages written (innodb_pages_written)",
271 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
272 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
273 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_PAGES_WRITTENcxx . . $ MONITOR_OVLD_PAGES_WRITTEN.},
274
275 {"buffer_pages_read", "buffer",
276 "Number of pages read (innodb_pages_read)",
277 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
278 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
279 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_PAGES_READcxx . . $ MONITOR_OVLD_PAGES_READ.},
280
281 {"buffer_data_reads", "buffer",
282 "Amount of data read in bytes (innodb_data_reads)",
283 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
284 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
285 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BYTE_READcxx . . $ MONITOR_OVLD_BYTE_READ.},
286
287 {"buffer_data_written", "buffer",
288 "Amount of data written in bytes (innodb_data_written)",
289 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
290 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
291 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BYTE_WRITTENcxx . . $ MONITOR_OVLD_BYTE_WRITTEN.},
292
293 /* Cumulative counter for scanning in flush batches */
294 {"buffer_flush_batch_scanned", "buffer",
295 "Total pages scanned as part of flush batch",
296 MONITOR_SET_OWNERcxx . . $ MONITOR_SET_OWNER.,
297 MONITOR_FLUSH_BATCH_SCANNED_NUM_CALLcxx . . $ MONITOR_FLUSH_BATCH_SCANNED_NUM_CALL.,
298 MONITOR_FLUSH_BATCH_SCANNEDcxx . . $ MONITOR_FLUSH_BATCH_SCANNED.},
299
300 {"buffer_flush_batch_num_scan", "buffer",
301 "Number of times buffer flush list flush is called",
302 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_FLUSH_BATCH_SCANNEDcxx . . $ MONITOR_FLUSH_BATCH_SCANNED.,
303 MONITOR_FLUSH_BATCH_SCANNED_NUM_CALLcxx . . $ MONITOR_FLUSH_BATCH_SCANNED_NUM_CALL.},
304
305 {"buffer_flush_batch_scanned_per_call", "buffer",
306 "Pages scanned per flush batch scan",
307 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_FLUSH_BATCH_SCANNEDcxx . . $ MONITOR_FLUSH_BATCH_SCANNED.,
308 MONITOR_FLUSH_BATCH_SCANNED_PER_CALLcxx . . $ MONITOR_FLUSH_BATCH_SCANNED_PER_CALL.},
309
310 /* Cumulative counter for pages flushed in flush batches */
311 {"buffer_flush_batch_total_pages", "buffer",
312 "Total pages flushed as part of flush batch",
313 MONITOR_SET_OWNERcxx . . $ MONITOR_SET_OWNER., MONITOR_FLUSH_BATCH_COUNTcxx . . $ MONITOR_FLUSH_BATCH_COUNT.,
314 MONITOR_FLUSH_BATCH_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_BATCH_TOTAL_PAGE.},
315
316 {"buffer_flush_batches", "buffer",
317 "Number of flush batches",
318 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_FLUSH_BATCH_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_BATCH_TOTAL_PAGE.,
319 MONITOR_FLUSH_BATCH_COUNTcxx . . $ MONITOR_FLUSH_BATCH_COUNT.},
320
321 {"buffer_flush_batch_pages", "buffer",
322 "Pages queued as a flush batch",
323 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_FLUSH_BATCH_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_BATCH_TOTAL_PAGE.,
324 MONITOR_FLUSH_BATCH_PAGEScxx . . $ MONITOR_FLUSH_BATCH_PAGES.},
325
326 /* Cumulative counter for flush batches because of neighbor */
327 {"buffer_flush_neighbor_total_pages", "buffer",
328 "Total neighbors flushed as part of neighbor flush",
329 MONITOR_SET_OWNERcxx . . $ MONITOR_SET_OWNER., MONITOR_FLUSH_NEIGHBOR_COUNTcxx . . $ MONITOR_FLUSH_NEIGHBOR_COUNT.,
330 MONITOR_FLUSH_NEIGHBOR_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_NEIGHBOR_TOTAL_PAGE.},
331
332 {"buffer_flush_neighbor", "buffer",
333 "Number of times neighbors flushing is invoked",
334 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_FLUSH_NEIGHBOR_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_NEIGHBOR_TOTAL_PAGE.,
335 MONITOR_FLUSH_NEIGHBOR_COUNTcxx . . $ MONITOR_FLUSH_NEIGHBOR_COUNT.},
336
337 {"buffer_flush_neighbor_pages", "buffer",
338 "Pages queued as a neighbor batch",
339 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_FLUSH_NEIGHBOR_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_NEIGHBOR_TOTAL_PAGE.,
340 MONITOR_FLUSH_NEIGHBOR_PAGEScxx . . $ MONITOR_FLUSH_NEIGHBOR_PAGES.},
341
342 {"buffer_flush_n_to_flush_requested", "buffer",
343 "Number of pages requested for flushing.",
344 MONITOR_NONEcxx . . $ MONITOR_NONE.,
345 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_FLUSH_N_TO_FLUSH_REQUESTEDcxx . . $ MONITOR_FLUSH_N_TO_FLUSH_REQUESTED.},
346
347 {"buffer_flush_n_to_flush_by_age", "buffer",
348 "Number of pages target by LSN Age for flushing.",
349 MONITOR_NONEcxx . . $ MONITOR_NONE.,
350 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_FLUSH_N_TO_FLUSH_BY_AGEcxx . . $ MONITOR_FLUSH_N_TO_FLUSH_BY_AGE.},
351
352 {"buffer_flush_adaptive_avg_time", "buffer",
353 "Avg time (ms) spent for adaptive flushing recently.",
354 MONITOR_NONEcxx . . $ MONITOR_NONE.,
355 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_FLUSH_ADAPTIVE_AVG_TIMEcxx . . $ MONITOR_FLUSH_ADAPTIVE_AVG_TIME.},
356
357 {"buffer_flush_adaptive_avg_pass", "buffer",
358 "Number of adaptive flushes passed during the recent Avg period.",
359 MONITOR_NONEcxx . . $ MONITOR_NONE.,
360 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_FLUSH_ADAPTIVE_AVG_PASScxx . . $ MONITOR_FLUSH_ADAPTIVE_AVG_PASS.},
361
362 {"buffer_LRU_get_free_loops", "buffer",
363 "Total loops in LRU get free.",
364 MONITOR_NONEcxx . . $ MONITOR_NONE.,
365 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_LRU_GET_FREE_LOOPScxx . . $ MONITOR_LRU_GET_FREE_LOOPS.},
366
367 {"buffer_flush_avg_page_rate", "buffer",
368 "Average number of pages at which flushing is happening",
369 MONITOR_NONEcxx . . $ MONITOR_NONE.,
370 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_FLUSH_AVG_PAGE_RATEcxx . . $ MONITOR_FLUSH_AVG_PAGE_RATE.},
371
372 {"buffer_flush_lsn_avg_rate", "buffer",
373 "Average redo generation rate",
374 MONITOR_NONEcxx . . $ MONITOR_NONE.,
375 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_FLUSH_LSN_AVG_RATEcxx . . $ MONITOR_FLUSH_LSN_AVG_RATE.},
376
377 {"buffer_flush_pct_for_dirty", "buffer",
378 "Percent of IO capacity used to avoid max dirty page limit",
379 MONITOR_NONEcxx . . $ MONITOR_NONE.,
380 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_FLUSH_PCT_FOR_DIRTYcxx . . $ MONITOR_FLUSH_PCT_FOR_DIRTY.},
381
382 {"buffer_flush_pct_for_lsn", "buffer",
383 "Percent of IO capacity used to avoid reusable redo space limit",
384 MONITOR_NONEcxx . . $ MONITOR_NONE.,
385 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_FLUSH_PCT_FOR_LSNcxx . . $ MONITOR_FLUSH_PCT_FOR_LSN.},
386
387 {"buffer_flush_sync_waits", "buffer",
388 "Number of times a wait happens due to sync flushing",
389 MONITOR_NONEcxx . . $ MONITOR_NONE.,
390 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_FLUSH_SYNC_WAITScxx . . $ MONITOR_FLUSH_SYNC_WAITS.},
391
392 /* Cumulative counter for flush batches for adaptive flushing */
393 {"buffer_flush_adaptive_total_pages", "buffer",
394 "Total pages flushed as part of adaptive flushing",
395 MONITOR_SET_OWNERcxx . . $ MONITOR_SET_OWNER., MONITOR_FLUSH_ADAPTIVE_COUNTcxx . . $ MONITOR_FLUSH_ADAPTIVE_COUNT.,
396 MONITOR_FLUSH_ADAPTIVE_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_ADAPTIVE_TOTAL_PAGE.},
397
398 {"buffer_flush_adaptive", "buffer",
399 "Number of adaptive batches",
400 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_FLUSH_ADAPTIVE_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_ADAPTIVE_TOTAL_PAGE.,
401 MONITOR_FLUSH_ADAPTIVE_COUNTcxx . . $ MONITOR_FLUSH_ADAPTIVE_COUNT.},
402
403 {"buffer_flush_adaptive_pages", "buffer",
404 "Pages queued as an adaptive batch",
405 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_FLUSH_ADAPTIVE_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_ADAPTIVE_TOTAL_PAGE.,
406 MONITOR_FLUSH_ADAPTIVE_PAGEScxx . . $ MONITOR_FLUSH_ADAPTIVE_PAGES.},
407
408 /* Cumulative counter for flush batches because of sync */
409 {"buffer_flush_sync_total_pages", "buffer",
410 "Total pages flushed as part of sync batches",
411 MONITOR_SET_OWNERcxx . . $ MONITOR_SET_OWNER., MONITOR_FLUSH_SYNC_COUNTcxx . . $ MONITOR_FLUSH_SYNC_COUNT.,
412 MONITOR_FLUSH_SYNC_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_SYNC_TOTAL_PAGE.},
413
414 {"buffer_flush_sync", "buffer",
415 "Number of sync batches",
416 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_FLUSH_SYNC_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_SYNC_TOTAL_PAGE.,
417 MONITOR_FLUSH_SYNC_COUNTcxx . . $ MONITOR_FLUSH_SYNC_COUNT.},
418
419 {"buffer_flush_sync_pages", "buffer",
420 "Pages queued as a sync batch",
421 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_FLUSH_SYNC_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_SYNC_TOTAL_PAGE.,
422 MONITOR_FLUSH_SYNC_PAGEScxx . . $ MONITOR_FLUSH_SYNC_PAGES.},
423
424 /* Cumulative counter for flush batches because of background */
425 {"buffer_flush_background_total_pages", "buffer",
426 "Total pages flushed as part of background batches",
427 MONITOR_SET_OWNERcxx . . $ MONITOR_SET_OWNER., MONITOR_FLUSH_BACKGROUND_COUNTcxx . . $ MONITOR_FLUSH_BACKGROUND_COUNT.,
428 MONITOR_FLUSH_BACKGROUND_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_BACKGROUND_TOTAL_PAGE.},
429
430 {"buffer_flush_background", "buffer",
431 "Number of background batches",
432 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_FLUSH_BACKGROUND_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_BACKGROUND_TOTAL_PAGE.,
433 MONITOR_FLUSH_BACKGROUND_COUNTcxx . . $ MONITOR_FLUSH_BACKGROUND_COUNT.},
434
435 {"buffer_flush_background_pages", "buffer",
436 "Pages queued as a background batch",
437 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_FLUSH_BACKGROUND_TOTAL_PAGEcxx . . $ MONITOR_FLUSH_BACKGROUND_TOTAL_PAGE.,
438 MONITOR_FLUSH_BACKGROUND_PAGEScxx . . $ MONITOR_FLUSH_BACKGROUND_PAGES.},
439
440 /* Cumulative counter for LRU batch scan */
441 {"buffer_LRU_batch_scanned", "buffer",
442 "Total pages scanned as part of LRU batch",
443 MONITOR_SET_OWNERcxx . . $ MONITOR_SET_OWNER., MONITOR_LRU_BATCH_SCANNED_NUM_CALLcxx . . $ MONITOR_LRU_BATCH_SCANNED_NUM_CALL.,
444 MONITOR_LRU_BATCH_SCANNEDcxx . . $ MONITOR_LRU_BATCH_SCANNED.},
445
446 {"buffer_LRU_batch_num_scan", "buffer",
447 "Number of times LRU batch is called",
448 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_LRU_BATCH_SCANNEDcxx . . $ MONITOR_LRU_BATCH_SCANNED.,
449 MONITOR_LRU_BATCH_SCANNED_NUM_CALLcxx . . $ MONITOR_LRU_BATCH_SCANNED_NUM_CALL.},
450
451 {"buffer_LRU_batch_scanned_per_call", "buffer",
452 "Pages scanned per LRU batch call",
453 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_LRU_BATCH_SCANNEDcxx . . $ MONITOR_LRU_BATCH_SCANNED.,
454 MONITOR_LRU_BATCH_SCANNED_PER_CALLcxx . . $ MONITOR_LRU_BATCH_SCANNED_PER_CALL.},
455
456 /* Cumulative counter for LRU batch pages flushed */
457 {"buffer_LRU_batch_flush_total_pages", "buffer",
458 "Total pages flushed as part of LRU batches",
459 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
460 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
461 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGEcxx . . $ MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE.},
462
463 /* Cumulative counter for LRU batch pages flushed */
464 {"buffer_LRU_batch_evict_total_pages", "buffer",
465 "Total pages evicted as part of LRU batches",
466 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
467 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
468 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_LRU_BATCH_EVICT_TOTAL_PAGEcxx . . $ MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE.},
469
470 {"buffer_LRU_get_free_search", "Buffer",
471 "Number of searches performed for a clean page",
472 MONITOR_NONEcxx . . $ MONITOR_NONE.,
473 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_LRU_GET_FREE_SEARCHcxx . . $ MONITOR_LRU_GET_FREE_SEARCH.},
474
475 /* Cumulative counter for LRU search scans */
476 {"buffer_LRU_search_scanned", "buffer",
477 "Total pages scanned as part of LRU search",
478 MONITOR_SET_OWNERcxx . . $ MONITOR_SET_OWNER.,
479 MONITOR_LRU_SEARCH_SCANNED_NUM_CALLcxx . . $ MONITOR_LRU_SEARCH_SCANNED_NUM_CALL.,
480 MONITOR_LRU_SEARCH_SCANNEDcxx . . $ MONITOR_LRU_SEARCH_SCANNED.},
481
482 {"buffer_LRU_search_num_scan", "buffer",
483 "Number of times LRU search is performed",
484 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_LRU_SEARCH_SCANNEDcxx . . $ MONITOR_LRU_SEARCH_SCANNED.,
485 MONITOR_LRU_SEARCH_SCANNED_NUM_CALLcxx . . $ MONITOR_LRU_SEARCH_SCANNED_NUM_CALL.},
486
487 {"buffer_LRU_search_scanned_per_call", "buffer",
488 "Page scanned per single LRU search",
489 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_LRU_SEARCH_SCANNEDcxx . . $ MONITOR_LRU_SEARCH_SCANNED.,
490 MONITOR_LRU_SEARCH_SCANNED_PER_CALLcxx . . $ MONITOR_LRU_SEARCH_SCANNED_PER_CALL.},
491
492 /* Cumulative counter for LRU unzip search scans */
493 {"buffer_LRU_unzip_search_scanned", "buffer",
494 "Total pages scanned as part of LRU unzip search",
495 MONITOR_SET_OWNERcxx . . $ MONITOR_SET_OWNER.,
496 MONITOR_LRU_UNZIP_SEARCH_SCANNED_NUM_CALLcxx . . $ MONITOR_LRU_UNZIP_SEARCH_SCANNED_NUM_CALL.,
497 MONITOR_LRU_UNZIP_SEARCH_SCANNEDcxx . . $ MONITOR_LRU_UNZIP_SEARCH_SCANNED.},
498
499 {"buffer_LRU_unzip_search_num_scan", "buffer",
500 "Number of times LRU unzip search is performed",
501 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_LRU_UNZIP_SEARCH_SCANNEDcxx . . $ MONITOR_LRU_UNZIP_SEARCH_SCANNED.,
502 MONITOR_LRU_UNZIP_SEARCH_SCANNED_NUM_CALLcxx . . $ MONITOR_LRU_UNZIP_SEARCH_SCANNED_NUM_CALL.},
503
504 {"buffer_LRU_unzip_search_scanned_per_call", "buffer",
505 "Page scanned per single LRU unzip search",
506 MONITOR_SET_MEMBERcxx . . $ MONITOR_SET_MEMBER., MONITOR_LRU_UNZIP_SEARCH_SCANNEDcxx . . $ MONITOR_LRU_UNZIP_SEARCH_SCANNED.,
507 MONITOR_LRU_UNZIP_SEARCH_SCANNED_PER_CALLcxx . . $ MONITOR_LRU_UNZIP_SEARCH_SCANNED_PER_CALL.},
508
509 /* ========== Counters for Buffer Page I/O ========== */
510 {"module_buffer_page", "buffer_page_io", "Buffer Page I/O Module",
511 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
512 MONITOR_MODULEcxx . . $ MONITOR_MODULE. | MONITOR_GROUP_MODULEcxx . . $ MONITOR_GROUP_MODULE.),
513 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_BUF_PAGEcxx . . $ MONITOR_MODULE_BUF_PAGE.},
514
515 MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!("index_leaf","Index Leaf", INDEX_LEAF),
516
517 MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!("index_non_leaf","Index Non-leaf",
518 INDEX_NON_LEAF),
519
520 MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!("undo_log", "Undo Log", UNDO_LOG),
521
522 MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!("index_inode", "Index Inode", INODE),
523
524 MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!("system_page", "System", SYSTEM),
525
526 MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!("trx_system", "Transaction System", TRX_SYSTEM),
527
528 MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!("fsp_hdr", "File Space Header", FSP_HDR),
529
530 MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!("xdes", "Extent Descriptor", XDES),
531
532 MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!("blob", "Uncompressed BLOB", BLOB),
533
534 MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!("zblob", "First Compressed BLOB", ZBLOB),
535
536 MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!("zblob2", "Subsequent Compressed BLOB", ZBLOB2),
537
538 MONITOR_BUF_PAGE_READcxx . . $ `storage/innobase/srv/srv0mon.cc:47:9`!("other", "other/unknown (old version of InnoDB)",
539 OTHER),
540
541 MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!("index_leaf","Index Leaf", INDEX_LEAF),
542
543 MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!("index_non_leaf","Index Non-leaf",
544 INDEX_NON_LEAF),
545
546 MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!("undo_log", "Undo Log", UNDO_LOG),
547
548 MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!("index_inode", "Index Inode", INODE),
549
550 MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!("system_page", "System", SYSTEM),
551
552 MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!("trx_system", "Transaction System",
553 TRX_SYSTEM),
554
555 MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!("fsp_hdr", "File Space Header", FSP_HDR),
556
557 MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!("xdes", "Extent Descriptor", XDES),
558
559 MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!("blob", "Uncompressed BLOB", BLOB),
560
561 MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!("zblob", "First Compressed BLOB", ZBLOB),
562
563 MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!("zblob2", "Subsequent Compressed BLOB",
564 ZBLOB2),
565
566 MONITOR_BUF_PAGE_WRITTENcxx . . $ `storage/innobase/srv/srv0mon.cc:50:9`!("other", "other/unknown (old version InnoDB)",
567 OTHER),
568
569 /* ========== Counters for OS level operations ========== */
570 {"module_os", "os", "OS Level Operation",
571 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
572 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_OScxx . . $ MONITOR_MODULE_OS.},
573
574 {"os_data_reads", "os",
575 "Number of reads initiated (innodb_data_reads)",
576 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
577 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
578 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_OS_FILE_READcxx . . $ MONITOR_OVLD_OS_FILE_READ.},
579
580 {"os_data_writes", "os",
581 "Number of writes initiated (innodb_data_writes)",
582 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
583 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
584 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_OS_FILE_WRITEcxx . . $ MONITOR_OVLD_OS_FILE_WRITE.},
585
586 {"os_data_fsyncs", "os",
587 "Number of fsync() calls (innodb_data_fsyncs)",
588 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
589 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
590 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_OS_FSYNCcxx . . $ MONITOR_OVLD_OS_FSYNC.},
591
592 {"os_pending_reads", "os", "Number of reads pending",
593 MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.,
594 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OS_PENDING_READScxx . . $ MONITOR_OS_PENDING_READS.},
595
596 {"os_pending_writes", "os", "Number of writes pending",
597 MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.,
598 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OS_PENDING_WRITEScxx . . $ MONITOR_OS_PENDING_WRITES.},
599
600 {"os_log_bytes_written", "os",
601 "Bytes of log written (innodb_os_log_written)",
602 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
603 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
604 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_OS_LOG_WRITTENcxx . . $ MONITOR_OVLD_OS_LOG_WRITTEN.},
605
606 /* ========== Counters for Transaction Module ========== */
607 {"module_trx", "transaction", "Transaction Manager",
608 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
609 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_TRXcxx . . $ MONITOR_MODULE_TRX.},
610
611 {"trx_rw_commits", "transaction",
612 "Number of read-write transactions committed",
613 MONITOR_NONEcxx . . $ MONITOR_NONE., MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_TRX_RW_COMMITcxx . . $ MONITOR_TRX_RW_COMMIT.},
614
615 {"trx_ro_commits", "transaction",
616 "Number of read-only transactions committed",
617 MONITOR_NONEcxx . . $ MONITOR_NONE., MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_TRX_RO_COMMITcxx . . $ MONITOR_TRX_RO_COMMIT.},
618
619 {"trx_nl_ro_commits", "transaction",
620 "Number of non-locking auto-commit read-only transactions committed",
621 MONITOR_NONEcxx . . $ MONITOR_NONE., MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_TRX_NL_RO_COMMITcxx . . $ MONITOR_TRX_NL_RO_COMMIT.},
622
623 {"trx_commits_insert_update", "transaction",
624 "Number of transactions committed with inserts and updates",
625 MONITOR_NONEcxx . . $ MONITOR_NONE.,
626 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_TRX_COMMIT_UNDOcxx . . $ MONITOR_TRX_COMMIT_UNDO.},
627
628 {"trx_rollbacks", "transaction",
629 "Number of transactions rolled back",
630 MONITOR_NONEcxx . . $ MONITOR_NONE.,
631 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_TRX_ROLLBACKcxx . . $ MONITOR_TRX_ROLLBACK.},
632
633 {"trx_rollbacks_savepoint", "transaction",
634 "Number of transactions rolled back to savepoint",
635 MONITOR_NONEcxx . . $ MONITOR_NONE.,
636 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_TRX_ROLLBACK_SAVEPOINTcxx . . $ MONITOR_TRX_ROLLBACK_SAVEPOINT.},
637
638 {"trx_rseg_history_len", "transaction",
639 "Length of the TRX_RSEG_HISTORY list",
640 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
641 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
642 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_RSEG_HISTORY_LENcxx . . $ MONITOR_RSEG_HISTORY_LEN.},
643
644 {"trx_undo_slots_used", "transaction", "Number of undo slots used",
645 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
646 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
647 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_NUM_UNDO_SLOT_USEDcxx . . $ MONITOR_NUM_UNDO_SLOT_USED.},
648
649 {"trx_undo_slots_cached", "transaction",
650 "Number of undo slots cached",
651 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
652 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
653 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_NUM_UNDO_SLOT_CACHEDcxx . . $ MONITOR_NUM_UNDO_SLOT_CACHED.},
654
655 {"trx_rseg_current_size", "transaction",
656 "Current rollback segment size in pages",
657 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
658 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
659 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_RSEG_CUR_SIZEcxx . . $ MONITOR_RSEG_CUR_SIZE.},
660
661 /* ========== Counters for Purge Module ========== */
662 {"module_purge", "purge", "Purge Module",
663 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
664 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_PURGEcxx . . $ MONITOR_MODULE_PURGE.},
665
666 {"purge_del_mark_records", "purge",
667 "Number of delete-marked rows purged",
668 MONITOR_NONEcxx . . $ MONITOR_NONE.,
669 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_N_DEL_ROW_PURGEcxx . . $ MONITOR_N_DEL_ROW_PURGE.},
670
671 {"purge_upd_exist_or_extern_records", "purge",
672 "Number of purges on updates of existing records and"
673 " updates on delete marked record with externally stored field",
674 MONITOR_NONEcxx . . $ MONITOR_NONE.,
675 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_N_UPD_EXIST_EXTERNcxx . . $ MONITOR_N_UPD_EXIST_EXTERN.},
676
677 {"purge_invoked", "purge",
678 "Number of times purge was invoked",
679 MONITOR_NONEcxx . . $ MONITOR_NONE.,
680 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_PURGE_INVOKEDcxx . . $ MONITOR_PURGE_INVOKED.},
681
682 {"purge_undo_log_pages", "purge",
683 "Number of undo log pages handled by the purge",
684 MONITOR_NONEcxx . . $ MONITOR_NONE.,
685 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_PURGE_N_PAGE_HANDLEDcxx . . $ MONITOR_PURGE_N_PAGE_HANDLED.},
686
687 {"purge_dml_delay_usec", "purge",
688 "Microseconds DML to be delayed due to purge lagging",
689 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
690 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
691 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_DML_PURGE_DELAYcxx . . $ MONITOR_DML_PURGE_DELAY.},
692
693 {"purge_stop_count", "purge",
694 "Number of times purge was stopped",
695 MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.,
696 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_PURGE_STOP_COUNTcxx . . $ MONITOR_PURGE_STOP_COUNT.},
697
698 {"purge_resume_count", "purge",
699 "Number of times purge was resumed",
700 MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.,
701 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_PURGE_RESUME_COUNTcxx . . $ MONITOR_PURGE_RESUME_COUNT.},
702
703 /* ========== Counters for Recovery Module ========== */
704 {"module_log", "recovery", "Recovery Module",
705 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
706 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_RECOVERYcxx . . $ MONITOR_MODULE_RECOVERY.},
707
708 {"log_checkpoints", "recovery", "Number of checkpoints",
709 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
710 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
711 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_CHECKPOINTScxx . . $ MONITOR_OVLD_CHECKPOINTS.},
712
713 {"log_lsn_last_flush", "recovery", "LSN of Last flush",
714 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
715 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
716 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_LSN_FLUSHDISKcxx . . $ MONITOR_OVLD_LSN_FLUSHDISK.},
717
718 {"log_lsn_last_checkpoint", "recovery", "LSN at last checkpoint",
719 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
720 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
721 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_LSN_CHECKPOINTcxx . . $ MONITOR_OVLD_LSN_CHECKPOINT.},
722
723 {"log_lsn_current", "recovery", "Current LSN value",
724 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
725 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
726 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_LSN_CURRENTcxx . . $ MONITOR_OVLD_LSN_CURRENT.},
727
728 {"log_lsn_checkpoint_age", "recovery",
729 "Current LSN value minus LSN at last checkpoint",
730 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
731 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
732 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_LSN_CHECKPOINT_AGEcxx . . $ MONITOR_LSN_CHECKPOINT_AGE.},
733
734 {"log_lsn_buf_pool_oldest", "recovery",
735 "The oldest modified block LSN in the buffer pool",
736 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
737 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
738 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_BUF_OLDEST_LSNcxx . . $ MONITOR_OVLD_BUF_OLDEST_LSN.},
739
740 {"log_max_modified_age_async", "recovery",
741 "Maximum LSN difference; when exceeded, start asynchronous preflush",
742 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
743 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
744 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_MAX_AGE_ASYNCcxx . . $ MONITOR_OVLD_MAX_AGE_ASYNC.},
745
746 {"log_waits", "recovery",
747 "Number of log waits due to small log buffer (innodb_log_waits)",
748 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
749 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
750 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_LOG_WAITScxx . . $ MONITOR_OVLD_LOG_WAITS.},
751
752 {"log_write_requests", "recovery",
753 "Number of log write requests (innodb_log_write_requests)",
754 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
755 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
756 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_LOG_WRITE_REQUESTcxx . . $ MONITOR_OVLD_LOG_WRITE_REQUEST.},
757
758 {"log_writes", "recovery",
759 "Number of log writes (innodb_log_writes)",
760 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
761 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
762 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_LOG_WRITEScxx . . $ MONITOR_OVLD_LOG_WRITES.},
763
764 /* ========== Counters for Page Compression ========== */
765 {"module_compress", "compression", "Page Compression Info",
766 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
767 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_PAGEcxx . . $ MONITOR_MODULE_PAGE.},
768
769 {"compress_pages_compressed", "compression",
770 "Number of pages compressed", MONITOR_NONEcxx . . $ MONITOR_NONE.,
771 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_PAGE_COMPRESScxx . . $ MONITOR_PAGE_COMPRESS.},
772
773 {"compress_pages_decompressed", "compression",
774 "Number of pages decompressed",
775 MONITOR_NONEcxx . . $ MONITOR_NONE.,
776 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_PAGE_DECOMPRESScxx . . $ MONITOR_PAGE_DECOMPRESS.},
777
778 {"compression_pad_increments", "compression",
779 "Number of times padding is incremented to avoid compression failures",
780 MONITOR_NONEcxx . . $ MONITOR_NONE.,
781 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_PAD_INCREMENTScxx . . $ MONITOR_PAD_INCREMENTS.},
782
783 {"compression_pad_decrements", "compression",
784 "Number of times padding is decremented due to good compressibility",
785 MONITOR_NONEcxx . . $ MONITOR_NONE.,
786 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_PAD_DECREMENTScxx . . $ MONITOR_PAD_DECREMENTS.},
787
788 {"compress_saved", "compression",
789 "Number of bytes saved by page compression",
790 MONITOR_NONEcxx . . $ MONITOR_NONE.,
791 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_PAGE_COMPRESS_SAVEDcxx . . $ MONITOR_OVLD_PAGE_COMPRESS_SAVED.},
792
793 {"compress_pages_page_compressed", "compression",
794 "Number of pages compressed by page compression",
795 MONITOR_NONEcxx . . $ MONITOR_NONE.,
796 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_PAGES_PAGE_COMPRESSEDcxx . . $ MONITOR_OVLD_PAGES_PAGE_COMPRESSED.},
797
798 {"compress_page_compressed_trim_op", "compression",
799 "Number of TRIM operation performed by page compression",
800 MONITOR_NONEcxx . . $ MONITOR_NONE.,
801 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OPcxx . . $ MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP.},
802
803 {"compress_pages_page_decompressed", "compression",
804 "Number of pages decompressed by page compression",
805 MONITOR_NONEcxx . . $ MONITOR_NONE.,
806 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_PAGES_PAGE_DECOMPRESSEDcxx . . $ MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED.},
807
808 {"compress_pages_page_compression_error", "compression",
809 "Number of page compression errors",
810 MONITOR_NONEcxx . . $ MONITOR_NONE.,
811 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_PAGES_PAGE_COMPRESSION_ERRORcxx . . $ MONITOR_OVLD_PAGES_PAGE_COMPRESSION_ERROR.},
812
813 {"compress_pages_encrypted", "compression",
814 "Number of pages encrypted",
815 MONITOR_NONEcxx . . $ MONITOR_NONE.,
816 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_PAGES_ENCRYPTEDcxx . . $ MONITOR_OVLD_PAGES_ENCRYPTED.},
817
818 {"compress_pages_decrypted", "compression",
819 "Number of pages decrypted",
820 MONITOR_NONEcxx . . $ MONITOR_NONE.,
821 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_PAGES_DECRYPTEDcxx . . $ MONITOR_OVLD_PAGES_DECRYPTED.},
822
823 /* ========== Counters for Index ========== */
824 {"module_index", "index", "Index Manager",
825 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
826 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_INDEXcxx . . $ MONITOR_MODULE_INDEX.},
827
828 {"index_page_splits", "index", "Number of index page splits",
829 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING.,
830 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_INDEX_SPLITcxx . . $ MONITOR_INDEX_SPLIT.},
831
832 {"index_page_merge_attempts", "index",
833 "Number of index page merge attempts",
834 MONITOR_NONEcxx . . $ MONITOR_NONE.,
835 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_INDEX_MERGE_ATTEMPTScxx . . $ MONITOR_INDEX_MERGE_ATTEMPTS.},
836
837 {"index_page_merge_successful", "index",
838 "Number of successful index page merges",
839 MONITOR_NONEcxx . . $ MONITOR_NONE.,
840 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_INDEX_MERGE_SUCCESSFULcxx . . $ MONITOR_INDEX_MERGE_SUCCESSFUL.},
841
842 {"index_page_reorg_attempts", "index",
843 "Number of index page reorganization attempts",
844 MONITOR_NONEcxx . . $ MONITOR_NONE.,
845 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_INDEX_REORG_ATTEMPTScxx . . $ MONITOR_INDEX_REORG_ATTEMPTS.},
846
847 {"index_page_reorg_successful", "index",
848 "Number of successful index page reorganizations",
849 MONITOR_NONEcxx . . $ MONITOR_NONE.,
850 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_INDEX_REORG_SUCCESSFULcxx . . $ MONITOR_INDEX_REORG_SUCCESSFUL.},
851
852 {"index_page_discards", "index", "Number of index pages discarded",
853 MONITOR_NONEcxx . . $ MONITOR_NONE.,
854 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_INDEX_DISCARDcxx . . $ MONITOR_INDEX_DISCARD.},
855
856 #ifdef BTR_CUR_HASH_ADAPTcxx . . $ `<built-in>:481:9`!
857 /* ========== Counters for Adaptive Hash Index ========== */
858 {"module_adaptive_hash", "adaptive_hash_index", "Adaptive Hash Index",
859 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
860 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_ADAPTIVE_HASHcxx . . $ MONITOR_MODULE_ADAPTIVE_HASH.},
861
862 {"adaptive_hash_searches", "adaptive_hash_index",
863 "Number of successful searches using Adaptive Hash Index",
864 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
865 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
866 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_ADAPTIVE_HASH_SEARCHcxx . . $ MONITOR_OVLD_ADAPTIVE_HASH_SEARCH.},
867
868 {"adaptive_hash_searches_btree", "adaptive_hash_index",
869 "Number of searches using B-tree on an index search",
870 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
871 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
872 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_ADAPTIVE_HASH_SEARCH_BTREEcxx . . $ MONITOR_OVLD_ADAPTIVE_HASH_SEARCH_BTREE.},
873
874 {"adaptive_hash_pages_added", "adaptive_hash_index",
875 "Number of index pages on which the Adaptive Hash Index is built",
876 MONITOR_NONEcxx . . $ MONITOR_NONE.,
877 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ADAPTIVE_HASH_PAGE_ADDEDcxx . . $ MONITOR_ADAPTIVE_HASH_PAGE_ADDED.},
878
879 {"adaptive_hash_pages_removed", "adaptive_hash_index",
880 "Number of index pages whose corresponding Adaptive Hash Index"
881 " entries were removed",
882 MONITOR_NONEcxx . . $ MONITOR_NONE.,
883 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ADAPTIVE_HASH_PAGE_REMOVEDcxx . . $ MONITOR_ADAPTIVE_HASH_PAGE_REMOVED.},
884
885 {"adaptive_hash_rows_added", "adaptive_hash_index",
886 "Number of Adaptive Hash Index rows added",
887 MONITOR_NONEcxx . . $ MONITOR_NONE.,
888 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ADAPTIVE_HASH_ROW_ADDEDcxx . . $ MONITOR_ADAPTIVE_HASH_ROW_ADDED.},
889
890 {"adaptive_hash_rows_removed", "adaptive_hash_index",
891 "Number of Adaptive Hash Index rows removed",
892 MONITOR_NONEcxx . . $ MONITOR_NONE.,
893 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ADAPTIVE_HASH_ROW_REMOVEDcxx . . $ MONITOR_ADAPTIVE_HASH_ROW_REMOVED.},
894
895 {"adaptive_hash_rows_deleted_no_hash_entry", "adaptive_hash_index",
896 "Number of rows deleted that did not have corresponding Adaptive Hash"
897 " Index entries",
898 MONITOR_NONEcxx . . $ MONITOR_NONE.,
899 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ADAPTIVE_HASH_ROW_REMOVE_NOT_FOUNDcxx . . $ MONITOR_ADAPTIVE_HASH_ROW_REMOVE_NOT_FOUND.},
900
901 {"adaptive_hash_rows_updated", "adaptive_hash_index",
902 "Number of Adaptive Hash Index rows updated",
903 MONITOR_NONEcxx . . $ MONITOR_NONE.,
904 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ADAPTIVE_HASH_ROW_UPDATEDcxx . . $ MONITOR_ADAPTIVE_HASH_ROW_UPDATED.},
905 #endif /* BTR_CUR_HASH_ADAPT */
906
907 /* ========== Counters for tablespace ========== */
908 {"module_file", "file_system", "Tablespace and File System Manager",
909 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
910 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_FIL_SYSTEMcxx . . $ MONITOR_MODULE_FIL_SYSTEM.},
911
912 {"file_num_open_files", "file_system",
913 "Number of files currently open (innodb_num_open_files)",
914 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
915 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
916 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_N_FILE_OPENEDcxx . . $ MONITOR_OVLD_N_FILE_OPENED.},
917
918 /* ========== Counters for server operations ========== */
919 {"module_innodb", "innodb",
920 "Counter for general InnoDB server wide operations and properties",
921 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
922 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_SERVERcxx . . $ MONITOR_MODULE_SERVER.},
923
924 {"innodb_master_thread_sleeps", "server",
925 "Number of times (seconds) master thread sleeps",
926 MONITOR_NONEcxx . . $ MONITOR_NONE.,
927 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MASTER_THREAD_SLEEPcxx . . $ MONITOR_MASTER_THREAD_SLEEP.},
928
929 {"innodb_activity_count", "server", "Current server activity count",
930 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
931 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
932 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_SERVER_ACTIVITYcxx . . $ MONITOR_OVLD_SERVER_ACTIVITY.},
933
934 {"innodb_master_active_loops", "server",
935 "Number of times master thread performs its tasks when"
936 " server is active",
937 MONITOR_NONEcxx . . $ MONITOR_NONE.,
938 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MASTER_ACTIVE_LOOPScxx . . $ MONITOR_MASTER_ACTIVE_LOOPS.},
939
940 {"innodb_master_idle_loops", "server",
941 "Number of times master thread performs its tasks when server is idle",
942 MONITOR_NONEcxx . . $ MONITOR_NONE.,
943 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MASTER_IDLE_LOOPScxx . . $ MONITOR_MASTER_IDLE_LOOPS.},
944
945 {"innodb_log_flush_usec", "server",
946 "Time (in microseconds) spent to flush log records",
947 MONITOR_NONEcxx . . $ MONITOR_NONE.,
948 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_SRV_LOG_FLUSH_MICROSECONDcxx . . $ MONITOR_SRV_LOG_FLUSH_MICROSECOND.},
949
950 {"innodb_dict_lru_usec", "server",
951 "Time (in microseconds) spent to process DICT LRU list",
952 MONITOR_NONEcxx . . $ MONITOR_NONE.,
953 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_SRV_DICT_LRU_MICROSECONDcxx . . $ MONITOR_SRV_DICT_LRU_MICROSECOND.},
954
955 {"innodb_dict_lru_count_active", "server",
956 "Number of tables evicted from DICT LRU list in the active loop",
957 MONITOR_NONEcxx . . $ MONITOR_NONE.,
958 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_SRV_DICT_LRU_EVICT_COUNT_ACTIVEcxx . . $ MONITOR_SRV_DICT_LRU_EVICT_COUNT_ACTIVE.},
959
960 {"innodb_dict_lru_count_idle", "server",
961 "Number of tables evicted from DICT LRU list in the idle loop",
962 MONITOR_NONEcxx . . $ MONITOR_NONE.,
963 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_SRV_DICT_LRU_EVICT_COUNT_IDLEcxx . . $ MONITOR_SRV_DICT_LRU_EVICT_COUNT_IDLE.},
964
965 {"innodb_dblwr_writes", "server",
966 "Number of doublewrite operations that have been performed"
967 " (innodb_dblwr_writes)",
968 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
969 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
970 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_SRV_DBLWR_WRITEScxx . . $ MONITOR_OVLD_SRV_DBLWR_WRITES.},
971
972 {"innodb_dblwr_pages_written", "server",
973 "Number of pages that have been written for doublewrite operations"
974 " (innodb_dblwr_pages_written)",
975 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
976 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.),
977 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_SRV_DBLWR_PAGES_WRITTENcxx . . $ MONITOR_OVLD_SRV_DBLWR_PAGES_WRITTEN.},
978
979 {"innodb_page_size", "server",
980 "InnoDB page size in bytes (innodb_page_size)",
981 static_cast<monitor_type_tcxx . . $ monitor_type_t#>(
982 MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING. | MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON. | MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.),
983 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_OVLD_SRV_PAGE_SIZEcxx . . $ MONITOR_OVLD_SRV_PAGE_SIZE.},
984
985 /* ========== Counters for DDL operations ========== */
986 {"module_ddl", "ddl", "Statistics for DDLs",
987 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
988 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_DDL_STATScxx . . $ MONITOR_MODULE_DDL_STATS.},
989
990 {"ddl_background_drop_indexes", "ddl",
991 "Number of indexes waiting to be dropped after failed index creation",
992 MONITOR_NONEcxx . . $ MONITOR_NONE.,
993 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_BACKGROUND_DROP_INDEXcxx . . $ MONITOR_BACKGROUND_DROP_INDEX.},
994
995 {"ddl_online_create_index", "ddl",
996 "Number of indexes being created online",
997 MONITOR_NONEcxx . . $ MONITOR_NONE.,
998 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ONLINE_CREATE_INDEXcxx . . $ MONITOR_ONLINE_CREATE_INDEX.},
999
1000 {"ddl_pending_alter_table", "ddl",
1001 "Number of ALTER TABLE, CREATE INDEX, DROP INDEX in progress",
1002 MONITOR_NONEcxx . . $ MONITOR_NONE.,
1003 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_PENDING_ALTER_TABLEcxx . . $ MONITOR_PENDING_ALTER_TABLE.},
1004
1005 {"ddl_sort_file_alter_table", "ddl",
1006 "Number of sort files created during alter table",
1007 MONITOR_NONEcxx . . $ MONITOR_NONE.,
1008 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ALTER_TABLE_SORT_FILEScxx . . $ MONITOR_ALTER_TABLE_SORT_FILES.},
1009
1010 {"ddl_log_file_alter_table", "ddl",
1011 "Number of log files created during alter table",
1012 MONITOR_NONEcxx . . $ MONITOR_NONE.,
1013 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ALTER_TABLE_LOG_FILEScxx . . $ MONITOR_ALTER_TABLE_LOG_FILES.},
1014
1015 /* ===== Counters for ICP (Index Condition Pushdown) Module ===== */
1016 {"module_icp", "icp", "Index Condition Pushdown",
1017 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
1018 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_MODULE_ICPcxx . . $ MONITOR_MODULE_ICP.},
1019
1020 {"icp_attempts", "icp",
1021 "Number of attempts for index push-down condition checks",
1022 MONITOR_NONEcxx . . $ MONITOR_NONE.,
1023 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ICP_ATTEMPTScxx . . $ MONITOR_ICP_ATTEMPTS.},
1024
1025 {"icp_no_match", "icp", "Index push-down condition does not match",
1026 MONITOR_NONEcxx . . $ MONITOR_NONE.,
1027 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ICP_NO_MATCHcxx . . $ MONITOR_ICP_NO_MATCH.},
1028
1029 {"icp_out_of_range", "icp", "Index push-down condition out of range",
1030 MONITOR_NONEcxx . . $ MONITOR_NONE.,
1031 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ICP_OUT_OF_RANGEcxx . . $ MONITOR_ICP_OUT_OF_RANGE.},
1032
1033 {"icp_match", "icp", "Index push-down condition matches",
1034 MONITOR_NONEcxx . . $ MONITOR_NONE.,
1035 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ICP_MATCHcxx . . $ MONITOR_ICP_MATCH.},
1036
1037 /* ========== To turn on/off reset all counters ========== */
1038 {"all", "All Counters", "Turn on/off and reset all counters",
1039 MONITOR_MODULEcxx . . $ MONITOR_MODULE.,
1040 MONITOR_DEFAULT_STARTcxx . . $ MONITOR_DEFAULT_START., MONITOR_ALL_COUNTERcxx . . $ MONITOR_ALL_COUNTER.}
1041 };
1042
1043 /* The "innodb_counter_value" array stores actual counter values */
1044 monitor_value_tcxx . . $ monitor_value_t# innodb_counter_valuecxx . . $ innodb_counter_value.[NUM_MONITORcxx . . $ NUM_MONITOR.];
1045
1046 /* monitor_set_tbl is used to record and determine whether a monitor
1047 has been turned on/off. */
1048 Atomic_relaxedcxx . . $ Atomic_relaxed#<ulintcxx . . $ ulint#>
1049 monitor_set_tblcxx . . $ monitor_set_tbl.[(NUM_MONITORcxx . . $ NUM_MONITOR. + NUM_BITS_ULINTcxx . . $ `storage/innobase/include/srv0mon.h:413:9`! - 1) / NUM_BITS_ULINTcxx . . $ `storage/innobase/include/srv0mon.h:413:9`!];
1050
1051 /****************************************************************//**
1052 Get a monitor's "monitor_info" by its monitor id (index into the
1053 innodb_counter_info array.
1054 @return Point to corresponding monitor_info_t, or NULL if no such
1055 monitor */
1056 monitor_info_tcxx . . $ monitor_info_t#*
1057 srv_mon_get_infocxx . . $ srv_mon_get_info(38f7fe4bfba6c7ac).(
1058 /*=============*/
1059 monitor_id_tcxx . . $ monitor_id_t# monitor_id) /*!< id indexing into the
1060 innodb_counter_info array */
1061 {
1062 ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(monitor_id < NUM_MONITOR);
1063
1064 return((monitor_id < NUM_MONITORcxx . . $ NUM_MONITOR.)
1065 ? &innodb_counter_infocxx . . $ innodb_counter_info.[monitor_id]
1066 : NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1067 }
1068
1069 /****************************************************************//**
1070 Get monitor's name by its monitor id (indexing into the
1071 innodb_counter_info array.
1072 @return corresponding monitor name, or NULL if no such
1073 monitor */
1074 const char*
1075 srv_mon_get_namecxx . . $ srv_mon_get_name(df49c1dadff3a43b).(
1076 /*=============*/
1077 monitor_id_tcxx . . $ monitor_id_t# monitor_id) /*!< id index into the
1078 innodb_counter_info array */
1079 {
1080 ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(monitor_id < NUM_MONITOR);
1081
1082 return((monitor_id < NUM_MONITORcxx . . $ NUM_MONITOR.)
1083 ? innodb_counter_infocxx . . $ innodb_counter_info.[monitor_id].monitor_namecxx . . $ monitor_info_t#monitor_name.
1084 : NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1085 }
1086
1087 /****************************************************************//**
1088 Turn on/off, reset monitor counters in a module. If module_id
1089 is MONITOR_ALL_COUNTER then turn on all monitor counters.
1090 turned on because it has already been turned on. */
1091 void
1092 srv_mon_set_module_controlcxx . . $ srv_mon_set_module_control(b1588fe2f67d7445).(
1093 /*=======================*/
1094 monitor_id_tcxx . . $ monitor_id_t# module_id, /*!< in: Module ID as in
1095 monitor_counter_id. If it is
1096 set to MONITOR_ALL_COUNTER, this means
1097 we shall turn on all the counters */
1098 mon_option_tcxx . . $ mon_option_t# set_option) /*!< in: Turn on/off reset the
1099 counter */
1100 {
1101 lintcxx . . $ lint# ix;
1102 lintcxx . . $ lint# start_id;
1103 iboolcxx . . $ `storage/innobase/include/univ.i:355:9`! set_current_module = FALSEcxx . . $ `include/my_global.h:477:9`!;
1104
1105 ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(module_id <= NUM_MONITOR);
1106 compile_time_assertcxx . . $ `include/my_global.h:377:9`!(array_elementscxx . . $ `include/my_global.h:472:9`!(innodb_counter_info)
1107 == NUM_MONITOR);
1108
1109 /* The module_id must be an ID of MONITOR_MODULE type */
1110 ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(innodb_counter_info[module_id].monitor_type & MONITOR_MODULE);
1111
1112 /* start with the first monitor in the module. If module_id
1113 is MONITOR_ALL_COUNTER, this means we need to turn on all
1114 monitor counters. */
1115 if (module_id == MONITOR_ALL_COUNTERcxx . . $ MONITOR_ALL_COUNTER.) {
1116 start_id = 1;
1117 } else if (innodb_counter_infocxx . . $ innodb_counter_info.[module_id].monitor_typecxx . . $ monitor_info_t#monitor_type.
1118 & MONITOR_GROUP_MODULEcxx . . $ MONITOR_GROUP_MODULE.) {
1119 /* Counters in this module are set as a group together
1120 and cannot be turned on/off individually. Need to set
1121 the on/off bit in the module counter */
1122 start_id = module_id;
1123 set_current_module = TRUEcxx . . $ `include/my_global.h:476:9`!;
1124
1125 } else {
1126 start_id = module_id + 1;
1127 }
1128
1129 for (ix = start_id; ix < NUM_MONITORcxx . . $ NUM_MONITOR.; ix++) {
1130 /* if we hit the next module counter, we will
1131 continue if we want to turn on all monitor counters,
1132 and break if just turn on the counters in the
1133 current module. */
1134 if (innodb_counter_infocxx . . $ innodb_counter_info.[ix].monitor_typecxx . . $ monitor_info_t#monitor_type. & MONITOR_MODULEcxx . . $ MONITOR_MODULE.) {
1135
1136 if (set_current_module) {
1137 /* Continue to set on/off bit on current
1138 module */
1139 set_current_module = FALSEcxx . . $ `include/my_global.h:477:9`!;
1140 } else if (module_id == MONITOR_ALL_COUNTERcxx . . $ MONITOR_ALL_COUNTER.) {
1141 if (!(innodb_counter_infocxx . . $ innodb_counter_info.[ix].monitor_typecxx . . $ monitor_info_t#monitor_type.
1142 & MONITOR_GROUP_MODULEcxx . . $ MONITOR_GROUP_MODULE.)) {
1143 continue;
1144 }
1145 } else {
1146 /* Hitting the next module, stop */
1147 break;
1148 }
1149 }
1150
1151 /* Cannot turn on a monitor already been turned on. User
1152 should be aware some counters are already on before
1153 turn them on again (which could reset counter value) */
1154 if (MONITOR_IS_ONcxx . . $ `storage/innobase/include/srv0mon.h:431:9`!(ix) && (set_option == MONITOR_TURN_ONcxx . . $ MONITOR_TURN_ON.)) {
1155 ibcxx . . $ ib/::infocxx . . $ ib/info#() <<cxx . . $ ib/logger#`operator<<`(dcbc6b5678e2764). "Monitor '"
1156 <<cxx . . $ ib/logger#`operator<<`(8dc2c095a0caceff). srv_mon_get_namecxx . . $ srv_mon_get_name(df49c1dadff3a43b).((monitor_id_tcxx . . $ monitor_id_t#) ix)
1157 <<cxx . . $ ib/logger#`operator<<`(dcbc6b5678e2764). "' is already enabled.";
1158 continue;
1159 }
1160
1161 /* For some existing counters (server status variables),
1162 we will get its counter value at the start/stop time
1163 to calculate the actual value during the time. */
1164 if (innodb_counter_infocxx . . $ innodb_counter_info.[ix].monitor_typecxx . . $ monitor_info_t#monitor_type. & MONITOR_EXISTINGcxx . . $ MONITOR_EXISTING.) {
1165 srv_mon_process_existing_countercxx . . $ srv_mon_process_existing_counter(b1588fe2f67d7445).(
1166 static_cast<monitor_id_tcxx . . $ monitor_id_t#>(ix), set_option);
1167 }
1168
1169 /* Currently support 4 operations on the monitor counters:
1170 turn on, turn off, reset and reset all operations. */
1171 switch (set_option) {
1172 case MONITOR_TURN_ONcxx . . $ MONITOR_TURN_ON.:
1173 MONITOR_ONcxx . . $ `storage/innobase/include/srv0mon.h:422:9`!(ix);
1174 MONITOR_INITcxx . . $ `storage/innobase/include/srv0mon.h:500:9`!(ix);
1175 MONITOR_SET_STARTcxx . . $ `storage/innobase/include/srv0mon.h:479:9`!(ix);
1176 break;
1177
1178 case MONITOR_TURN_OFFcxx . . $ MONITOR_TURN_OFF.:
1179 MONITOR_OFFcxx . . $ `storage/innobase/include/srv0mon.h:426:9`!(ix);
1180 MONITOR_SET_OFFcxx . . $ `storage/innobase/include/srv0mon.h:485:9`!(ix);
1181 break;
1182
1183 case MONITOR_RESET_VALUEcxx . . $ MONITOR_RESET_VALUE.:
1184 srv_mon_resetcxx . . $ srv_mon_reset(9c0237a1485ff094).(static_cast<monitor_id_tcxx . . $ monitor_id_t#>(ix));
1185 break;
1186
1187 case MONITOR_RESET_ALL_VALUEcxx . . $ MONITOR_RESET_ALL_VALUE.:
1188 srv_mon_reset_allcxx . . $ srv_mon_reset_all(9b3e53177c55ffd).(static_cast<monitor_id_tcxx . . $ monitor_id_t#>(ix));
1189 break;
1190
1191 default:
1192 ut_errorcxx . . $ `storage/innobase/include/ut0dbg.h:58:9`!;
1193 }
1194 }
1195 }
1196
1197 /** Reset all values.
1198 @param monitor monitor identifier */
1199 void srv_mon_reset_allcxx . . $ srv_mon_reset_all(9b3e53177c55ffd).(monitor_id_tcxx . . $ monitor_id_t# monitor) noexcept
1200 {
1201 if (MONITOR_IS_ONcxx . . $ `storage/innobase/include/srv0mon.h:431:9`!(monitor))
1202 sql_print_warningcxx . . $ sql_print_warning(326aeb464d16410c).("InnoDB: Cannot reset all values for monitor counter '%s' "
1203 "while it is on. Please turn it off and retry.",
1204 srv_mon_get_namecxx . . $ srv_mon_get_name(df49c1dadff3a43b).(monitor));
1205 else
1206 MONITOR_RESET_ALLcxx . . $ `storage/innobase/include/srv0mon.h:692:9`!(monitor);
1207 }
1208
1209 /****************************************************************//**
1210 Get transaction system's rollback segment size in pages
1211 @return size in pages */
1212 TPOOL_SUPPRESS_TSANcxx . . $ `tpool/tpool_structs.h:38:9`! static ulintcxx . . $ ulint# srv_mon_get_rseg_sizecxx . . $ srv_mon_get_rseg_size(f708dce9a8856c70).()
1213 {
1214 ulintcxx . . $ ulint# size= 0;
1215 for (const auto &rseg : trx_syscxx . . $ trx_sys..rseg_arraycxx . . $ trx_sys_t#rseg_array.)
1216 size+= rseg.curr_sizecxx . . $ trx_rseg_t#curr_size.;
1217 return size;
1218 }
1219
1220 /** @return number of used undo log slots */
1221 TPOOL_SUPPRESS_TSANcxx . . $ `tpool/tpool_structs.h:38:9`! static ulintcxx . . $ ulint# srv_mon_get_rseg_usedcxx . . $ srv_mon_get_rseg_used(f708dce9a8856c70).()
1222 {
1223 ulintcxx . . $ ulint# size= 0;
1224 for (const auto &rseg : trx_syscxx . . $ trx_sys..rseg_arraycxx . . $ trx_sys_t#rseg_array.)
1225 size+= UT_LIST_GET_LENcxx . . $ `storage/innobase/include/ut0lst.h:415:9`!(rseg.undo_list);
1226 return size;
1227 }
1228
1229 /** @return number of cached undo log slots */
1230 TPOOL_SUPPRESS_TSANcxx . . $ `tpool/tpool_structs.h:38:9`! static ulintcxx . . $ ulint# srv_mon_get_rseg_cachedcxx . . $ srv_mon_get_rseg_cached(f708dce9a8856c70).()
1231 {
1232 ulintcxx . . $ ulint# size= 0;
1233 for (const auto &rseg : trx_syscxx . . $ trx_sys..rseg_arraycxx . . $ trx_sys_t#rseg_array.)
1234 size+= UT_LIST_GET_LENcxx . . $ `storage/innobase/include/ut0lst.h:415:9`!(rseg.undo_cached);
1235 return size;
1236 }
1237
1238 /****************************************************************//**
1239 This function consolidates some existing server counters used
1240 by "system status variables". These existing system variables do not have
1241 mechanism to start/stop and reset the counters, so we simulate these
1242 controls by remembering the corresponding counter values when the
1243 corresponding monitors are turned on/off/reset, and do appropriate
1244 mathematics to deduct the actual value. Please also refer to
1245 srv_export_innodb_status() for related global counters used by
1246 the existing status variables.*/
1247 TPOOL_SUPPRESS_TSANcxx . . $ `tpool/tpool_structs.h:38:9`!
1248 void
1249 srv_mon_process_existing_countercxx . . $ srv_mon_process_existing_counter(b1588fe2f67d7445).(
1250 /*=============================*/
1251 monitor_id_tcxx . . $ monitor_id_t# monitor_id, /*!< in: the monitor's ID as in
1252 monitor_counter_id */
1253 mon_option_tcxx . . $ mon_option_t# set_option) /*!< in: Turn on/off reset the
1254 counter */
1255 {
1256 mon_type_tcxx . . $ mon_type_t# value;
1257 monitor_info_tcxx . . $ monitor_info_t#* monitor_info;
1258 iboolcxx . . $ `storage/innobase/include/univ.i:355:9`! update_min = FALSEcxx . . $ `include/my_global.h:477:9`!;
1259
1260 monitor_info = srv_mon_get_infocxx . . $ srv_mon_get_info(38f7fe4bfba6c7ac).(monitor_id);
1261
1262 ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(monitor_info->monitor_type & MONITOR_EXISTING);
1263 ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(monitor_id < NUM_MONITOR);
1264
1265 /* Get the value from corresponding global variable */
1266 switch (monitor_id) {
1267 case MONITOR_INDEX_SPLITcxx . . $ MONITOR_INDEX_SPLIT.:
1268 value = buf_poolcxx . . $ buf_pool..pages_splitcxx . . $ buf_pool_t#pages_split.;
1269 break;
1270
1271 case MONITOR_OVLD_BUF_POOL_READScxx . . $ MONITOR_OVLD_BUF_POOL_READS.:
1272 value = buf_poolcxx . . $ buf_pool..statcxx . . $ buf_pool_t#stat..n_pages_readcxx . . $ buf_pool_stat_t#n_pages_read.;
1273 break;
1274
1275 /* innodb_buffer_pool_read_requests, the number of logical
1276 read requests */
1277 case MONITOR_OVLD_BUF_POOL_READ_REQUESTScxx . . $ MONITOR_OVLD_BUF_POOL_READ_REQUESTS.:
1278 value = buf_poolcxx . . $ buf_pool..statcxx . . $ buf_pool_t#stat..n_page_getscxx . . $ buf_pool_stat_t#$anonymous_type_3#n_page_gets.;
1279 break;
1280
1281 /* innodb_buffer_pool_write_requests, the number of
1282 write request */
1283 case MONITOR_OVLD_BUF_POOL_WRITE_REQUESTcxx . . $ MONITOR_OVLD_BUF_POOL_WRITE_REQUEST.:
1284 value = buf_poolcxx . . $ buf_pool..flush_list_requestscxx . . $ buf_pool_t#flush_list_requests.;
1285 break;
1286
1287 /* innodb_buffer_pool_wait_free */
1288 case MONITOR_OVLD_BUF_POOL_WAIT_FREEcxx . . $ MONITOR_OVLD_BUF_POOL_WAIT_FREE.:
1289 value = buf_poolcxx . . $ buf_pool..statcxx . . $ buf_pool_t#stat..LRU_waitscxx . . $ buf_pool_stat_t#LRU_waits.;
1290 break;
1291
1292 /* innodb_buffer_pool_read_ahead */
1293 case MONITOR_OVLD_BUF_POOL_READ_AHEADcxx . . $ MONITOR_OVLD_BUF_POOL_READ_AHEAD.:
1294 value = buf_poolcxx . . $ buf_pool..statcxx . . $ buf_pool_t#stat..n_ra_pages_readcxx . . $ buf_pool_stat_t#n_ra_pages_read.;
1295 break;
1296
1297 /* innodb_buffer_pool_read_ahead_evicted */
1298 case MONITOR_OVLD_BUF_POOL_READ_AHEAD_EVICTEDcxx . . $ MONITOR_OVLD_BUF_POOL_READ_AHEAD_EVICTED.:
1299 value = buf_poolcxx . . $ buf_pool..statcxx . . $ buf_pool_t#stat..n_ra_pages_evictedcxx . . $ buf_pool_stat_t#n_ra_pages_evicted.;
1300 break;
1301
1302 /* innodb_buffer_pool_pages_total */
1303 case MONITOR_OVLD_BUF_POOL_PAGE_TOTALcxx . . $ MONITOR_OVLD_BUF_POOL_PAGE_TOTAL.:
1304 case MONITOR_OVLD_BUFFER_POOL_SIZEcxx . . $ MONITOR_OVLD_BUFFER_POOL_SIZE.:
1305 value = buf_poolcxx . . $ buf_pool..curr_sizecxx . . $ buf_pool_t#curr_size(c9b1e749b64d5edc).();
1306 break;
1307
1308 /* innodb_buffer_pool_pages_misc */
1309 case MONITOR_OVLD_BUF_POOL_PAGE_MISCcxx . . $ MONITOR_OVLD_BUF_POOL_PAGE_MISC.:
1310 value = buf_poolcxx . . $ buf_pool..curr_sizecxx . . $ buf_pool_t#curr_size(c9b1e749b64d5edc).()
1311 - UT_LIST_GET_LENcxx . . $ `storage/innobase/include/ut0lst.h:415:9`!(buf_pool.LRU)
1312 - UT_LIST_GET_LENcxx . . $ `storage/innobase/include/ut0lst.h:415:9`!(buf_pool.free);
1313 break;
1314
1315 /* innodb_buffer_pool_pages_data */
1316 case MONITOR_OVLD_BUF_POOL_PAGES_DATAcxx . . $ MONITOR_OVLD_BUF_POOL_PAGES_DATA.:
1317 value = UT_LIST_GET_LENcxx . . $ `storage/innobase/include/ut0lst.h:415:9`!(buf_pool.LRU);
1318 break;
1319
1320 /* innodb_buffer_pool_bytes_data */
1321 case MONITOR_OVLD_BUF_POOL_BYTES_DATAcxx . . $ MONITOR_OVLD_BUF_POOL_BYTES_DATA.:
1322 value = buf_poolcxx . . $ buf_pool..statcxx . . $ buf_pool_t#stat..LRU_bytescxx . . $ buf_pool_stat_t#LRU_bytes.
1323 + (UT_LIST_GET_LENcxx . . $ `storage/innobase/include/ut0lst.h:415:9`!(buf_pool.unzip_LRU)
1324 << srv_page_size_shiftcxx . . $ srv_page_size_shift.);
1325 break;
1326
1327 /* innodb_buffer_pool_pages_dirty */
1328 case MONITOR_OVLD_BUF_POOL_PAGES_DIRTYcxx . . $ MONITOR_OVLD_BUF_POOL_PAGES_DIRTY.:
1329 value = UT_LIST_GET_LENcxx . . $ `storage/innobase/include/ut0lst.h:415:9`!(buf_pool.flush_list);
1330 break;
1331
1332 /* innodb_buffer_pool_bytes_dirty */
1333 case MONITOR_OVLD_BUF_POOL_BYTES_DIRTYcxx . . $ MONITOR_OVLD_BUF_POOL_BYTES_DIRTY.:
1334 value = buf_poolcxx . . $ buf_pool..flush_list_bytescxx . . $ buf_pool_t#flush_list_bytes.;
1335 break;
1336
1337 /* innodb_buffer_pool_pages_free */
1338 case MONITOR_OVLD_BUF_POOL_PAGES_FREEcxx . . $ MONITOR_OVLD_BUF_POOL_PAGES_FREE.:
1339 value = UT_LIST_GET_LENcxx . . $ `storage/innobase/include/ut0lst.h:415:9`!(buf_pool.free);
1340 break;
1341
1342 /* innodb_pages_created, the number of pages created */
1343 case MONITOR_OVLD_PAGE_CREATEDcxx . . $ MONITOR_OVLD_PAGE_CREATED.:
1344 value = buf_poolcxx . . $ buf_pool..statcxx . . $ buf_pool_t#stat..n_pages_createdcxx . . $ buf_pool_stat_t#n_pages_created.;
1345 break;
1346
1347 /* innodb_pages_written, the number of page written */
1348 case MONITOR_OVLD_PAGES_WRITTENcxx . . $ MONITOR_OVLD_PAGES_WRITTEN.:
1349 value = buf_poolcxx . . $ buf_pool..statcxx . . $ buf_pool_t#stat..n_pages_writtencxx . . $ buf_pool_stat_t#n_pages_written.;
1350 break;
1351
1352 case MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGEcxx . . $ MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE.:
1353 value = buf_lru_flush_page_countcxx . . $ buf_lru_flush_page_count.;
1354 break;
1355
1356 case MONITOR_LRU_BATCH_EVICT_TOTAL_PAGEcxx . . $ MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE.:
1357 value = buf_lru_freed_page_countcxx . . $ buf_lru_freed_page_count.;
1358 break;
1359
1360 /* innodb_pages_read */
1361 case MONITOR_OVLD_PAGES_READcxx . . $ MONITOR_OVLD_PAGES_READ.:
1362 value = buf_poolcxx . . $ buf_pool..statcxx . . $ buf_pool_t#stat..n_pages_readcxx . . $ buf_pool_stat_t#n_pages_read.;
1363 break;
1364
1365 /* innodb_data_reads, the total number of data reads */
1366 case MONITOR_OVLD_BYTE_READcxx . . $ MONITOR_OVLD_BYTE_READ.:
1367 value = srv_statscxx . . $ srv_stats..data_readcxx . . $ srv_stats_t#data_read.;
1368 break;
1369
1370 /* innodb_data_writes, the total number of data writes. */
1371 case MONITOR_OVLD_BYTE_WRITTENcxx . . $ MONITOR_OVLD_BYTE_WRITTEN.:
1372 value = srv_statscxx . . $ srv_stats..data_writtencxx . . $ srv_stats_t#data_written.;
1373 break;
1374
1375 /* innodb_data_reads, the total number of data reads. */
1376 case MONITOR_OVLD_OS_FILE_READcxx . . $ MONITOR_OVLD_OS_FILE_READ.:
1377 value = os_n_file_readscxx . . $ os_n_file_reads.;
1378 break;
1379
1380 /* innodb_data_writes, the total number of data writes*/
1381 case MONITOR_OVLD_OS_FILE_WRITEcxx . . $ MONITOR_OVLD_OS_FILE_WRITE.:
1382 value = os_n_file_writescxx . . $ os_n_file_writes.;
1383 break;
1384
1385 /* innodb_data_fsyncs, number of fsync() operations so far. */
1386 case MONITOR_OVLD_OS_FSYNCcxx . . $ MONITOR_OVLD_OS_FSYNC.:
1387 value = os_n_fsyncscxx . . $ os_n_fsyncs.;
1388 break;
1389
1390 /* innodb_os_log_written */
1391 case MONITOR_OVLD_OS_LOG_WRITTENcxx . . $ MONITOR_OVLD_OS_LOG_WRITTEN.:
1392 value = log_get_lsncxx . . $ log_get_lsn(cee159cc271e827).() - recv_syscxx . . $ recv_sys..lsncxx . . $ recv_sys_t#lsn.;
1393 break;
1394
1395 /* innodb_log_waits */
1396 case MONITOR_OVLD_LOG_WAITScxx . . $ MONITOR_OVLD_LOG_WAITS.:
1397 value = log_syscxx . . $ log_sys..waitscxx . . $ log_t#waits.;
1398 break;
1399
1400 /* innodb_log_write_requests */
1401 case MONITOR_OVLD_LOG_WRITE_REQUESTcxx . . $ MONITOR_OVLD_LOG_WRITE_REQUEST.:
1402 value = log_syscxx . . $ log_sys..write_to_bufcxx . . $ log_t#write_to_buf.;
1403 break;
1404
1405 /* innodb_log_writes */
1406 case MONITOR_OVLD_LOG_WRITEScxx . . $ MONITOR_OVLD_LOG_WRITES.:
1407 value = log_syscxx . . $ log_sys..write_to_logcxx . . $ log_t#write_to_log.;
1408 break;
1409
1410 /* innodb_dblwr_writes */
1411 case MONITOR_OVLD_SRV_DBLWR_WRITEScxx . . $ MONITOR_OVLD_SRV_DBLWR_WRITES.:
1412 buf_dblwrcxx . . $ buf_dblwr..lockcxx . . $ buf_dblwr_t#lock(ced63f7c635d850d).();
1413 value = buf_dblwrcxx . . $ buf_dblwr..batchescxx . . $ buf_dblwr_t#batches(c9b1e749b64d5edc).();
1414 buf_dblwrcxx . . $ buf_dblwr..unlockcxx . . $ buf_dblwr_t#unlock(ced63f7c635d850d).();
1415 break;
1416
1417 /* innodb_dblwr_pages_written */
1418 case MONITOR_OVLD_SRV_DBLWR_PAGES_WRITTENcxx . . $ MONITOR_OVLD_SRV_DBLWR_PAGES_WRITTEN.:
1419 buf_dblwrcxx . . $ buf_dblwr..lockcxx . . $ buf_dblwr_t#lock(ced63f7c635d850d).();
1420 value = buf_dblwrcxx . . $ buf_dblwr..writtencxx . . $ buf_dblwr_t#written(c9b1e749b64d5edc).();
1421 buf_dblwrcxx . . $ buf_dblwr..unlockcxx . . $ buf_dblwr_t#unlock(ced63f7c635d850d).();
1422 break;
1423
1424 /* innodb_page_size */
1425 case MONITOR_OVLD_SRV_PAGE_SIZEcxx . . $ MONITOR_OVLD_SRV_PAGE_SIZE.:
1426 value = srv_page_sizecxx . . $ srv_page_size.;
1427 break;
1428
1429 /* innodb_row_lock_current_waits */
1430 case MONITOR_OVLD_ROW_LOCK_CURRENT_WAITcxx . . $ MONITOR_OVLD_ROW_LOCK_CURRENT_WAIT.:
1431 // dirty read without lock_sys.wait_mutex
1432 value = lock_syscxx . . $ lock_sys..get_wait_pendingcxx . . $ lock_sys_t#get_wait_pending(fe4d2d262d4164a8).();
1433 break;
1434
1435 /* innodb_row_lock_time */
1436 case MONITOR_OVLD_LOCK_WAIT_TIMEcxx . . $ MONITOR_OVLD_LOCK_WAIT_TIME.:
1437 // dirty read without lock_sys.wait_mutex
1438 value = lock_syscxx . . $ lock_sys..get_wait_time_cumulativecxx . . $ lock_sys_t#get_wait_time_cumulative(fe4d2d262d4164a8).();
1439 break;
1440
1441 /* innodb_row_lock_time_max */
1442 case MONITOR_OVLD_LOCK_MAX_WAIT_TIMEcxx . . $ MONITOR_OVLD_LOCK_MAX_WAIT_TIME.:
1443 // dirty read without lock_sys.wait_mutex
1444 value = lock_syscxx . . $ lock_sys..get_wait_time_maxcxx . . $ lock_sys_t#get_wait_time_max(fe4d2d262d4164a8).();
1445 break;
1446
1447 /* innodb_row_lock_time_avg */
1448 case MONITOR_OVLD_LOCK_AVG_WAIT_TIMEcxx . . $ MONITOR_OVLD_LOCK_AVG_WAIT_TIME.:
1449 mysql_mutex_lockcxx . . $ `include/mysql/psi/mysql_thread.h:360:11`!(&lock_sys.wait_mutex);
1450 if (auto count = lock_syscxx . . $ lock_sys..get_wait_cumulativecxx . . $ lock_sys_t#get_wait_cumulative(fe4d2d262d4164a8).()) {
1451 value = lock_syscxx . . $ lock_sys..get_wait_time_cumulativecxx . . $ lock_sys_t#get_wait_time_cumulative(fe4d2d262d4164a8).() / count;
1452 } else {
1453 value = 0;
1454 }
1455 mysql_mutex_unlockcxx . . $ `include/mysql/psi/mysql_thread.h:391:11`!(&lock_sys.wait_mutex);
1456 break;
1457
1458 /* innodb_row_lock_waits */
1459 case MONITOR_OVLD_ROW_LOCK_WAITcxx . . $ MONITOR_OVLD_ROW_LOCK_WAIT.:
1460 // dirty read without lock_sys.wait_mutex
1461 value = lock_syscxx . . $ lock_sys..get_wait_cumulativecxx . . $ lock_sys_t#get_wait_cumulative(fe4d2d262d4164a8).();
1462 break;
1463
1464 case MONITOR_RSEG_HISTORY_LENcxx . . $ MONITOR_RSEG_HISTORY_LEN.:
1465 value = trx_syscxx . . $ trx_sys..history_size_approxcxx . . $ trx_sys_t#history_size_approx(fe4d2d262d4164a8).();
1466 break;
1467
1468 case MONITOR_RSEG_CUR_SIZEcxx . . $ MONITOR_RSEG_CUR_SIZE.:
1469 value = srv_mon_get_rseg_sizecxx . . $ srv_mon_get_rseg_size(f708dce9a8856c70).();
1470 break;
1471 case MONITOR_DML_PURGE_DELAYcxx . . $ MONITOR_DML_PURGE_DELAY.:
1472 value = srv_max_purge_lag_delaycxx . . $ srv_max_purge_lag_delay.;
1473 break;
1474 case MONITOR_NUM_UNDO_SLOT_USEDcxx . . $ MONITOR_NUM_UNDO_SLOT_USED.:
1475 value = srv_mon_get_rseg_usedcxx . . $ srv_mon_get_rseg_used(f708dce9a8856c70).();
1476 break;
1477 case MONITOR_NUM_UNDO_SLOT_CACHEDcxx . . $ MONITOR_NUM_UNDO_SLOT_CACHED.:
1478 value = srv_mon_get_rseg_cachedcxx . . $ srv_mon_get_rseg_cached(f708dce9a8856c70).();
1479 break;
1480 case MONITOR_OVLD_N_FILE_OPENEDcxx . . $ MONITOR_OVLD_N_FILE_OPENED.:
1481 value = fil_systemcxx . . $ fil_system..n_opencxx . . $ fil_system_t#n_open.;
1482 break;
1483
1484 case MONITOR_OVLD_SERVER_ACTIVITYcxx . . $ MONITOR_OVLD_SERVER_ACTIVITY.:
1485 value = srv_get_activity_countcxx . . $ srv_get_activity_count(f708dce9a8856c70).();
1486 break;
1487
1488 case MONITOR_OVLD_LSN_FLUSHDISKcxx . . $ MONITOR_OVLD_LSN_FLUSHDISK.:
1489 value = log_syscxx . . $ log_sys..get_flushed_lsncxx . . $ log_t#get_flushed_lsn(40133418db5a06a).();
1490 break;
1491
1492 case MONITOR_OVLD_LSN_CURRENTcxx . . $ MONITOR_OVLD_LSN_CURRENT.:
1493 value = log_get_lsncxx . . $ log_get_lsn(cee159cc271e827).();
1494 break;
1495
1496 case MONITOR_OVLD_CHECKPOINTScxx . . $ MONITOR_OVLD_CHECKPOINTS.:
1497 value = log_syscxx . . $ log_sys..next_checkpoint_nocxx . . $ log_t#next_checkpoint_no.;
1498 break;
1499
1500 case MONITOR_LSN_CHECKPOINT_AGEcxx . . $ MONITOR_LSN_CHECKPOINT_AGE.:
1501 log_syscxx . . $ log_sys..latchcxx . . $ log_t#latch..wr_lockcxx . . $ ssux_lock_impl#wr_lock(ced63f7c635d850d).();
1502 value = static_cast<mon_type_tcxx . . $ mon_type_t#>(log_syscxx . . $ log_sys..get_lsncxx . . $ log_t#get_lsn(c9b1e749b64d5edc).()
1503 - log_syscxx . . $ log_sys..last_checkpoint_lsncxx . . $ log_t#last_checkpoint_lsn.);
1504 log_syscxx . . $ log_sys..latchcxx . . $ log_t#latch..wr_unlockcxx . . $ ssux_lock_impl#wr_unlock(ced63f7c635d850d).();
1505 break;
1506
1507 case MONITOR_OVLD_BUF_OLDEST_LSNcxx . . $ MONITOR_OVLD_BUF_OLDEST_LSN.:
1508 mysql_mutex_lockcxx . . $ `include/mysql/psi/mysql_thread.h:360:11`!(&buf_pool.flush_list_mutex);
1509 value = (mon_type_tcxx . . $ mon_type_t#) buf_poolcxx . . $ buf_pool..get_oldest_modificationcxx . . $ buf_pool_t#get_oldest_modification(a6c5aadce0732900).(0);
1510 mysql_mutex_unlockcxx . . $ `include/mysql/psi/mysql_thread.h:391:11`!(&buf_pool.flush_list_mutex);
1511 break;
1512
1513 case MONITOR_OVLD_LSN_CHECKPOINTcxx . . $ MONITOR_OVLD_LSN_CHECKPOINT.:
1514 value = (mon_type_tcxx . . $ mon_type_t#) log_syscxx . . $ log_sys..last_checkpoint_lsncxx . . $ log_t#last_checkpoint_lsn.;
1515 break;
1516
1517 case MONITOR_OVLD_MAX_AGE_ASYNCcxx . . $ MONITOR_OVLD_MAX_AGE_ASYNC.:
1518 value = log_syscxx . . $ log_sys..max_modified_age_asynccxx . . $ log_t#max_modified_age_async.;
1519 break;
1520
1521 #ifdef BTR_CUR_HASH_ADAPTcxx . . $ `<built-in>:481:9`!
1522 case MONITOR_OVLD_ADAPTIVE_HASH_SEARCHcxx . . $ MONITOR_OVLD_ADAPTIVE_HASH_SEARCH.:
1523 value = btr_cur_n_seacxx . . $ btr_cur_n_sea.;
1524 break;
1525
1526 case MONITOR_OVLD_ADAPTIVE_HASH_SEARCH_BTREEcxx . . $ MONITOR_OVLD_ADAPTIVE_HASH_SEARCH_BTREE.:
1527 value = btr_cur_n_non_seacxx . . $ btr_cur_n_non_sea.;
1528 break;
1529 #endif /* BTR_CUR_HASH_ADAPT */
1530
1531 case MONITOR_OVLD_PAGE_COMPRESS_SAVEDcxx . . $ MONITOR_OVLD_PAGE_COMPRESS_SAVED.:
1532 value = srv_statscxx . . $ srv_stats..page_compression_savedcxx . . $ srv_stats_t#page_compression_saved.;
1533 break;
1534 case MONITOR_OVLD_PAGES_PAGE_COMPRESSEDcxx . . $ MONITOR_OVLD_PAGES_PAGE_COMPRESSED.:
1535 value = srv_statscxx . . $ srv_stats..pages_page_compressedcxx . . $ srv_stats_t#pages_page_compressed.;
1536 break;
1537 case MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OPcxx . . $ MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP.:
1538 value = srv_statscxx . . $ srv_stats..page_compressed_trim_opcxx . . $ srv_stats_t#page_compressed_trim_op.;
1539 break;
1540 case MONITOR_OVLD_PAGES_PAGE_DECOMPRESSEDcxx . . $ MONITOR_OVLD_PAGES_PAGE_DECOMPRESSED.:
1541 value = srv_statscxx . . $ srv_stats..pages_page_decompressedcxx . . $ srv_stats_t#pages_page_decompressed.;
1542 break;
1543 case MONITOR_OVLD_PAGES_PAGE_COMPRESSION_ERRORcxx . . $ MONITOR_OVLD_PAGES_PAGE_COMPRESSION_ERROR.:
1544 value = srv_statscxx . . $ srv_stats..pages_page_compression_errorcxx . . $ srv_stats_t#pages_page_compression_error.;
1545 break;
1546 case MONITOR_OVLD_PAGES_ENCRYPTEDcxx . . $ MONITOR_OVLD_PAGES_ENCRYPTED.:
1547 value = srv_statscxx . . $ srv_stats..pages_encryptedcxx . . $ srv_stats_t#pages_encrypted.;
1548 break;
1549 case MONITOR_OVLD_PAGES_DECRYPTEDcxx . . $ MONITOR_OVLD_PAGES_DECRYPTED.:
1550 value = srv_statscxx . . $ srv_stats..pages_decryptedcxx . . $ srv_stats_t#pages_decrypted.;
1551 break;
1552 case MONITOR_DEADLOCKcxx . . $ MONITOR_DEADLOCK.:
1553 value = lock_syscxx . . $ lock_sys..deadlockscxx . . $ lock_sys_t#deadlocks.;
1554 break;
1555 case MONITOR_TIMEOUTcxx . . $ MONITOR_TIMEOUT.:
1556 value = lock_syscxx . . $ lock_sys..timeoutscxx . . $ lock_sys_t#timeouts.;
1557 break;
1558 default:
1559 ut_errorcxx . . $ `storage/innobase/include/ut0dbg.h:58:9`!;
1560 }
1561
1562 switch (set_option) {
1563 case MONITOR_TURN_ONcxx . . $ MONITOR_TURN_ON.:
1564 /* Save the initial counter value in mon_start_value
1565 field */
1566 MONITOR_SAVE_STARTcxx . . $ `storage/innobase/include/srv0mon.h:714:9`!(monitor_id, value);
1567 return;
1568
1569 case MONITOR_TURN_OFFcxx . . $ MONITOR_TURN_OFF.:
1570 /* Save the counter value to mon_last_value when we
1571 turn off the monitor but not yet reset. Note the
1572 counter has not yet been set to off in the bitmap
1573 table for normal turn off. We need to check the
1574 count status (on/off) to avoid reset the value
1575 for an already off conte */
1576 if (MONITOR_IS_ONcxx . . $ `storage/innobase/include/srv0mon.h:431:9`!(monitor_id)) {
1577 srv_mon_process_existing_countercxx . . $ srv_mon_process_existing_counter(b1588fe2f67d7445).(monitor_id,
1578 MONITOR_GET_VALUEcxx . . $ MONITOR_GET_VALUE.);
1579 MONITOR_SAVE_LASTcxx . . $ `storage/innobase/include/srv0mon.h:722:9`!(monitor_id);
1580 }
1581 return;
1582
1583 case MONITOR_GET_VALUEcxx . . $ MONITOR_GET_VALUE.:
1584 if (MONITOR_IS_ONcxx . . $ `storage/innobase/include/srv0mon.h:431:9`!(monitor_id)) {
1585
1586 /* If MONITOR_DISPLAY_CURRENT bit is on, we
1587 only record the current value, rather than
1588 incremental value over a period. Most of
1589 ` this type of counters are resource related
1590 counters such as number of buffer pages etc. */
1591 if (monitor_info->monitor_typecxx . . $ monitor_info_t#monitor_type.
1592 & MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.) {
1593 MONITOR_SETcxx . . $ `storage/innobase/include/srv0mon.h:620:9`!(monitor_id, value);
1594 } else {
1595 /* Most status counters are montonically
1596 increasing, no need to update their
1597 minimum values. Only do so
1598 if "update_min" set to TRUE */
1599 MONITOR_SET_DIFFcxx . . $ `storage/innobase/include/srv0mon.h:730:9`!(monitor_id, value);
1600
1601 if (update_min
1602 && (MONITOR_VALUEcxx . . $ `storage/innobase/include/srv0mon.h:449:9`!(monitor_id)
1603 < MONITOR_MIN_VALUEcxx . . $ `storage/innobase/include/srv0mon.h:455:9`!(monitor_id))) {
1604 MONITOR_MIN_VALUEcxx . . $ `storage/innobase/include/srv0mon.h:455:9`!(monitor_id) =
1605 MONITOR_VALUEcxx . . $ `storage/innobase/include/srv0mon.h:449:9`!(monitor_id);
1606 }
1607 }
1608 }
1609 return;
1610
1611 case MONITOR_RESET_VALUEcxx . . $ MONITOR_RESET_VALUE.:
1612 if (!MONITOR_IS_ONcxx . . $ `storage/innobase/include/srv0mon.h:431:9`!(monitor_id)) {
1613 MONITOR_LAST_VALUEcxx . . $ `storage/innobase/include/srv0mon.h:467:9`!(monitor_id) = 0;
1614 }
1615 return;
1616
1617 /* Nothing special for reset all operation for these existing
1618 counters */
1619 case MONITOR_RESET_ALL_VALUEcxx . . $ MONITOR_RESET_ALL_VALUE.:
1620 return;
1621 }
1622 }
1623
1624 /*************************************************************//**
1625 Reset a monitor, create a new base line with the current monitor
1626 value. This baseline is recorded by MONITOR_VALUE_RESET(monitor) */
1627 void
1628 srv_mon_resetcxx . . $ srv_mon_reset(9c0237a1485ff094).(
1629 /*==========*/
1630 monitor_id_tcxx . . $ monitor_id_t# monitor) /*!< in: monitor id */
1631 {
1632 iboolcxx . . $ `storage/innobase/include/univ.i:355:9`! monitor_was_on;
1633
1634 monitor_was_on = MONITOR_IS_ONcxx . . $ `storage/innobase/include/srv0mon.h:431:9`!(monitor);
1635
1636 if (monitor_was_on) {
1637 /* Temporarily turn off the counter for the resetting
1638 operation */
1639 MONITOR_OFFcxx . . $ `storage/innobase/include/srv0mon.h:426:9`!(monitor);
1640 }
1641
1642 /* Before resetting the current monitor value, first
1643 calculate and set the max/min value since monitor
1644 start */
1645 srv_mon_calc_max_since_startcxx . . $ srv_mon_calc_max_since_start(ef5468d4870f2138).(monitor);
1646 srv_mon_calc_min_since_startcxx . . $ srv_mon_calc_min_since_start(ef5468d4870f2138).(monitor);
1647
1648 /* Monitors with MONITOR_DISPLAY_CURRENT bit
1649 are not incremental, no need to remember
1650 the reset value. */
1651 if (innodb_counter_infocxx . . $ innodb_counter_info.[monitor].monitor_typecxx . . $ monitor_info_t#monitor_type.
1652 & MONITOR_DISPLAY_CURRENTcxx . . $ MONITOR_DISPLAY_CURRENT.) {
1653 MONITOR_VALUE_RESETcxx . . $ `storage/innobase/include/srv0mon.h:458:9`!(monitor) = 0;
1654 } else {
1655 /* Remember the new baseline */
1656 MONITOR_VALUE_RESETcxx . . $ `storage/innobase/include/srv0mon.h:458:9`!(monitor) = MONITOR_VALUE_RESETcxx . . $ `storage/innobase/include/srv0mon.h:458:9`!(monitor)
1657 + MONITOR_VALUEcxx . . $ `storage/innobase/include/srv0mon.h:449:9`!(monitor);
1658 }
1659
1660 /* Reset the counter value */
1661 MONITOR_VALUEcxx . . $ `storage/innobase/include/srv0mon.h:449:9`!(monitor) = 0;
1662 MONITOR_MAX_VALUEcxx . . $ `storage/innobase/include/srv0mon.h:452:9`!(monitor) = MAX_RESERVEDcxx . . $ `storage/innobase/include/srv0mon.h:116:9`!;
1663 MONITOR_MIN_VALUEcxx . . $ `storage/innobase/include/srv0mon.h:455:9`!(monitor) = MIN_RESERVEDcxx . . $ `storage/innobase/include/srv0mon.h:115:9`!;
1664
1665 MONITOR_FIELDcxx . . $ `storage/innobase/include/srv0mon.h:446:9`!((monitor), mon_reset_time) = time(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1666
1667 if (monitor_was_on) {
1668 MONITOR_ONcxx . . $ `storage/innobase/include/srv0mon.h:422:9`!(monitor);
1669 }
1670 }
1671
1672 /*************************************************************//**
1673 Turn on monitor counters that are marked as default ON. */
1674 void
1675 srv_mon_default_oncxx . . $ srv_mon_default_on(49f6e7a06ebc5aa8).(void)
1676 /*====================*/
1677 {
1678 ulintcxx . . $ ulint# ix;
1679
1680 for (ix = 0; ix < NUM_MONITORcxx . . $ NUM_MONITOR.; ix++) {
1681 if (innodb_counter_infocxx . . $ innodb_counter_info.[ix].monitor_typecxx . . $ monitor_info_t#monitor_type.
1682 & MONITOR_DEFAULT_ONcxx . . $ MONITOR_DEFAULT_ON.) {
1683 /* Turn on monitor counters that are default on */
1684 MONITOR_ONcxx . . $ `storage/innobase/include/srv0mon.h:422:9`!(ix);
1685 MONITOR_INITcxx . . $ `storage/innobase/include/srv0mon.h:500:9`!(ix);
1686 MONITOR_SET_STARTcxx . . $ `storage/innobase/include/srv0mon.h:479:9`!(ix);
1687 }
1688 }
1689 }