-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathsrv0mon.cc
2118 lines (1666 loc) · 83.7 KB
/
srv0mon.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*****************************************************************************
Copyright (c) 2010, 2025, Oracle and/or its affiliates.
Copyright (c) 2012, Facebook Inc.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License, version 2.0, as published by the
Free Software Foundation.
This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have either included with
the program or referenced in the documentation.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*****************************************************************************/
/** @file srv/srv0mon.cc
Database monitor counter interfaces
Created 12/9/2009 Jimmy Yang
*******************************************************/
#include <time.h>
#include "arch0arch.h"
#include "buf0buf.h"
#include "dict0mem.h"
#include "ibuf0ibuf.h"
#include "lock0lock.h"
#include "log0buf.h"
#include "log0chkp.h"
#include "log0write.h"
#include "mach0data.h"
#include "os0file.h"
#include "srv0mon.h"
#include "srv0srv.h"
#include "trx0purge.h"
#include "trx0rseg.h"
#include "trx0sys.h"
/* Macro to standardize the counter names for counters in the
"monitor_buf_page" module as they have very structured defines */
#define MONITOR_BUF_PAGE(name, description, code, op, op_code) \
{ \
"buffer_page_" op "_" name, "buffer_page_io", \
"Number of " description " Pages " op, MONITOR_GROUP_MODULE, \
MONITOR_DEFAULT_START, MONITOR_##code##_##op_code \
}
#define MONITOR_BUF_PAGE_READ(name, description, code) \
MONITOR_BUF_PAGE(name, description, code, "read", PAGE_READ)
#define MONITOR_BUF_PAGE_WRITTEN(name, description, code) \
MONITOR_BUF_PAGE(name, description, code, "written", PAGE_WRITTEN)
#define MONITOR_WAIT_STATS_EX(name, module, description, code, wrap) \
wrap(name "no_waits", module, description, MONITOR_NONE, \
MONITOR_DEFAULT_START, code##NO_WAITS), \
wrap(name "waits", module, description, MONITOR_NONE, \
MONITOR_DEFAULT_START, code##WAITS), \
wrap(name "wait_loops", module, description, MONITOR_NONE, \
MONITOR_DEFAULT_START, code##WAIT_LOOPS)
#define MONITOR_WAIT_STATS_SIMPLE_WRAP(a1, a2, a3, a4, a5, a6) \
{ a1, a2, a3, a4, a5, a6 }
#define MONITOR_WAIT_STATS(name, module, description, code) \
MONITOR_WAIT_STATS_EX(name, module, description, code, \
MONITOR_WAIT_STATS_SIMPLE_WRAP)
#define MONITOR_BUF_PAGE_WRITTEN_WAIT_STATS_WRAP(name, module, description, a, \
b, code) \
MONITOR_BUF_PAGE_WRITTEN(name, description, code)
#define MONITOR_BUF_PAGE_WRITTEN_WAIT_STATS(name, description, code) \
MONITOR_WAIT_STATS_EX(name, "", description, code, \
MONITOR_BUF_PAGE_WRITTEN_WAIT_STATS_WRAP)
/** This array defines basic static information of monitor counters,
including each monitor's name, module it belongs to, a short
description and its property/type and corresponding monitor_id.
Please note: If you add a monitor here, please add its corresponding
monitor_id to "enum monitor_id_value" structure in srv0mon.h file. */
// NOTE: please keep the counter descriptions below in sync with the
// description of the matching metrics in handler/ha_innodb.cc
static monitor_info_t innodb_counter_info[] = {
/* A dummy item to mark the module start, this is
to accommodate the default value (0) set for the
global variables with the control system. */
{"module_start", "module_start", "module_start", MONITOR_MODULE,
MONITOR_DEFAULT_START, MONITOR_DEFAULT_START},
/* ========== Counters for Server Metadata ========== */
{"module_metadata", "metadata", "Server Metadata", MONITOR_MODULE,
MONITOR_DEFAULT_START, MONITOR_MODULE_METADATA},
{"metadata_table_handles_opened", "metadata",
"Number of table handles opened", MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_TABLE_OPEN},
{"metadata_table_handles_closed", "metadata",
"Number of table handles closed", MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_TABLE_CLOSE},
{"metadata_table_reference_count", "metadata", "Table reference counter",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_TABLE_REFERENCE},
/* ========== Counters for Lock Module ========== */
{"module_lock", "lock", "Lock Module", MONITOR_MODULE,
MONITOR_DEFAULT_START, MONITOR_MODULE_LOCK},
{"lock_deadlocks", "lock", "Number of deadlocks", MONITOR_DEFAULT_ON,
MONITOR_DEFAULT_START, MONITOR_DEADLOCK},
{"lock_deadlock_false_positives", "lock",
"Number of times a heuristic found a spurious candidate deadlock cycle in "
"the wait-for graph",
MONITOR_DEFAULT_ON, MONITOR_DEFAULT_START,
MONITOR_DEADLOCK_FALSE_POSITIVES},
{"lock_deadlock_rounds", "lock",
"Number of times a wait-for graph was scanned in search for deadlocks",
MONITOR_DEFAULT_ON, MONITOR_DEFAULT_START, MONITOR_DEADLOCK_ROUNDS},
{"lock_threads_waiting", "lock",
"Number of query threads sleeping waiting for a lock",
static_cast<monitor_type_t>(MONITOR_DEFAULT_ON | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_LOCK_THREADS_WAITING},
{"lock_timeouts", "lock", "Number of lock timeouts", MONITOR_DEFAULT_ON,
MONITOR_DEFAULT_START, MONITOR_TIMEOUT},
{"lock_rec_lock_waits", "lock",
"Number of times enqueued into record lock wait queue", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_LOCKREC_WAIT},
{"lock_table_lock_waits", "lock",
"Number of times enqueued into table lock wait queue", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_TABLELOCK_WAIT},
{"lock_rec_lock_requests", "lock", "Number of record locks requested",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_NUM_RECLOCK_REQ},
{"lock_rec_release_attempts", "lock",
"Number of times we attempted to release record locks", MONITOR_DEFAULT_ON,
MONITOR_DEFAULT_START, MONITOR_RECLOCK_RELEASE_ATTEMPTS},
{"lock_rec_grant_attempts", "lock",
"Number of times we attempted to grant locks for a record",
MONITOR_DEFAULT_ON, MONITOR_DEFAULT_START, MONITOR_RECLOCK_GRANT_ATTEMPTS},
{"lock_rec_lock_created", "lock", "Number of record locks created",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_RECLOCK_CREATED},
{"lock_rec_lock_removed", "lock",
"Number of record locks removed from the lock queue", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_RECLOCK_REMOVED},
{"lock_rec_locks", "lock", "Current number of record locks on tables",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_NUM_RECLOCK},
{"lock_table_lock_created", "lock", "Number of table locks created",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_TABLELOCK_CREATED},
{"lock_table_lock_removed", "lock",
"Number of table locks removed from the lock queue", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_TABLELOCK_REMOVED},
{"lock_table_locks", "lock", "Current number of table locks on tables",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_NUM_TABLELOCK},
{"lock_row_lock_current_waits", "lock",
"Number of row locks currently being waited for"
" (innodb_row_lock_current_waits)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_ROW_LOCK_CURRENT_WAIT},
{"lock_row_lock_time", "lock",
"Time spent in acquiring row locks, in milliseconds"
" (innodb_row_lock_time)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_LOCK_WAIT_TIME},
{"lock_row_lock_time_max", "lock",
"The maximum time to acquire a row lock, in milliseconds"
" (innodb_row_lock_time_max)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT |
MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_LOCK_MAX_WAIT_TIME},
{"lock_row_lock_waits", "lock",
"Number of times a row lock had to be waited for"
" (innodb_row_lock_waits)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_ROW_LOCK_WAIT},
{"lock_row_lock_time_avg", "lock",
"The average time to acquire a row lock, in milliseconds"
" (innodb_row_lock_time_avg)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT |
MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_LOCK_AVG_WAIT_TIME},
{"lock_schedule_refreshes", "lock",
"Number of times the wait-for graph was analyzed to update schedule "
"weights of transactions",
MONITOR_DEFAULT_ON, MONITOR_DEFAULT_START, MONITOR_SCHEDULE_REFRESHES},
/* ========== Counters for Buffer Manager and I/O ========== */
{"module_buffer", "buffer", "Buffer Manager Module", MONITOR_MODULE,
MONITOR_DEFAULT_START, MONITOR_MODULE_BUFFER},
{"buffer_pool_size", "server",
"Server buffer pool size (all buffer pools) in bytes",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON |
MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUFFER_POOL_SIZE},
{"buffer_pool_reads", "buffer",
"Number of reads directly from disk (innodb_buffer_pool_reads)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_READS},
{"buffer_pool_read_requests", "buffer",
"Number of logical read requests (innodb_buffer_pool_read_requests)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_READ_REQUESTS},
{"buffer_pool_write_requests", "buffer",
"Number of write requests (innodb_buffer_pool_write_requests)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_WRITE_REQUEST},
{"buffer_pool_wait_free", "buffer",
"Number of times waited for free buffer"
" (innodb_buffer_pool_wait_free)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_WAIT_FREE},
{"buffer_pool_read_ahead", "buffer",
"Number of pages read as read ahead (innodb_buffer_pool_read_ahead)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_READ_AHEAD},
{"buffer_pool_read_ahead_evicted", "buffer",
"Read-ahead pages evicted without being accessed"
" (innodb_buffer_pool_read_ahead_evicted)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_READ_AHEAD_EVICTED},
{"buffer_pool_pages_total", "buffer",
"Total buffer pool size in pages (innodb_buffer_pool_pages_total)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT |
MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_PAGE_TOTAL},
{"buffer_pool_pages_misc", "buffer",
"Buffer pages for misc use such as row locks or the adaptive"
" hash index (innodb_buffer_pool_pages_misc)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT |
MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_PAGE_MISC},
{"buffer_pool_pages_data", "buffer",
"Buffer pages containing data (innodb_buffer_pool_pages_data)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT |
MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_PAGES_DATA},
{"buffer_pool_bytes_data", "buffer",
"Buffer bytes containing data (innodb_buffer_pool_bytes_data)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT |
MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_BYTES_DATA},
{"buffer_pool_pages_dirty", "buffer",
"Buffer pages currently dirty (innodb_buffer_pool_pages_dirty)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT |
MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_PAGES_DIRTY},
{"buffer_pool_bytes_dirty", "buffer",
"Buffer bytes currently dirty (innodb_buffer_pool_bytes_dirty)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT |
MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_BYTES_DIRTY},
{"buffer_pool_pages_free", "buffer",
"Buffer pages currently free (innodb_buffer_pool_pages_free)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT |
MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_POOL_PAGES_FREE},
{"buffer_pages_created", "buffer",
"Number of pages created (innodb_pages_created)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_CREATED},
{"buffer_pages_written", "buffer",
"Number of pages written (innodb_pages_written)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGES_WRITTEN},
{"buffer_pages_read", "buffer", "Number of pages read (innodb_pages_read)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGES_READ},
{"buffer_data_reads", "buffer",
"Amount of data read in bytes (innodb_data_read)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BYTE_READ},
{"buffer_data_written", "buffer",
"Amount of data written in bytes (innodb_data_written)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_BYTE_WRITTEN},
/* Cumulative counter for scanning in flush batches */
{"buffer_flush_batch_scanned", "buffer",
"Total pages scanned as part of flush batch", MONITOR_SET_OWNER,
MONITOR_FLUSH_BATCH_SCANNED_NUM_CALL, MONITOR_FLUSH_BATCH_SCANNED},
{"buffer_flush_batch_num_scan", "buffer",
"Number of times buffer flush list flush is called", MONITOR_SET_MEMBER,
MONITOR_FLUSH_BATCH_SCANNED, MONITOR_FLUSH_BATCH_SCANNED_NUM_CALL},
{"buffer_flush_batch_scanned_per_call", "buffer",
"Pages scanned per flush batch scan", MONITOR_SET_MEMBER,
MONITOR_FLUSH_BATCH_SCANNED, MONITOR_FLUSH_BATCH_SCANNED_PER_CALL},
/* Cumulative counter for pages flushed in flush batches */
{"buffer_flush_batch_total_pages", "buffer",
"Total pages flushed as part of flush batch", MONITOR_SET_OWNER,
MONITOR_FLUSH_BATCH_COUNT, MONITOR_FLUSH_BATCH_TOTAL_PAGE},
{"buffer_flush_batches", "buffer", "Number of flush batches",
MONITOR_SET_MEMBER, MONITOR_FLUSH_BATCH_TOTAL_PAGE,
MONITOR_FLUSH_BATCH_COUNT},
{"buffer_flush_batch_pages", "buffer", "Pages queued as a flush batch",
MONITOR_SET_MEMBER, MONITOR_FLUSH_BATCH_TOTAL_PAGE,
MONITOR_FLUSH_BATCH_PAGES},
/* Cumulative counter for flush batches because of neighbor */
{"buffer_flush_neighbor_total_pages", "buffer",
"Total neighbors flushed as part of neighbor flush", MONITOR_SET_OWNER,
MONITOR_FLUSH_NEIGHBOR_COUNT, MONITOR_FLUSH_NEIGHBOR_TOTAL_PAGE},
{"buffer_flush_neighbor", "buffer",
"Number of times neighbors flushing is invoked", MONITOR_SET_MEMBER,
MONITOR_FLUSH_NEIGHBOR_TOTAL_PAGE, MONITOR_FLUSH_NEIGHBOR_COUNT},
{"buffer_flush_neighbor_pages", "buffer",
"Pages queued as a neighbor batch", MONITOR_SET_MEMBER,
MONITOR_FLUSH_NEIGHBOR_TOTAL_PAGE, MONITOR_FLUSH_NEIGHBOR_PAGES},
{"buffer_flush_n_to_flush_requested", "buffer",
"Number of pages requested for flushing.", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_FLUSH_N_TO_FLUSH_REQUESTED},
{"buffer_flush_n_to_flush_by_dirty_page", "buffer",
"Number of pages targeted by dirty page percentage for flushing.",
MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_FLUSH_N_TO_FLUSH_BY_DIRTY_PAGE},
{"buffer_flush_n_to_flush_by_age", "buffer",
"Number of pages targeted by LSN Age for flushing.", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_FLUSH_N_TO_FLUSH_BY_AGE},
{"buffer_flush_adaptive_avg_time_slot", "buffer",
"Avg time (ms) spent for adaptive flushing recently per slot.",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_FLUSH_ADAPTIVE_AVG_TIME_SLOT},
{"buffer_LRU_batch_flush_avg_time_slot", "buffer",
"Avg time (ms) spent for LRU batch flushing recently per slot.",
MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_LRU_BATCH_FLUSH_AVG_TIME_SLOT},
{"buffer_flush_adaptive_avg_time_thread", "buffer",
"Avg time (ms) spent for adaptive flushing recently per thread.",
MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_FLUSH_ADAPTIVE_AVG_TIME_THREAD},
{"buffer_LRU_batch_flush_avg_time_thread", "buffer",
"Avg time (ms) spent for LRU batch flushing recently per thread.",
MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_LRU_BATCH_FLUSH_AVG_TIME_THREAD},
{"buffer_flush_adaptive_avg_time_est", "buffer",
"Estimated time (ms) spent for adaptive flushing recently.", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_FLUSH_ADAPTIVE_AVG_TIME_EST},
{"buffer_LRU_batch_flush_avg_time_est", "buffer",
"Estimated time (ms) spent for LRU batch flushing recently.", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_LRU_BATCH_FLUSH_AVG_TIME_EST},
{"buffer_flush_avg_time", "buffer",
"Avg time (ms) spent for flushing recently.", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_FLUSH_AVG_TIME},
{"buffer_flush_adaptive_avg_pass", "buffer",
"Number of adaptive flushes passed during the recent Avg period.",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_FLUSH_ADAPTIVE_AVG_PASS},
{"buffer_LRU_batch_flush_avg_pass", "buffer",
"Number of LRU batch flushes passed during the recent Avg period.",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_LRU_BATCH_FLUSH_AVG_PASS},
{"buffer_flush_avg_pass", "buffer",
"Number of flushes passed during the recent Avg period.", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_FLUSH_AVG_PASS},
{"buffer_LRU_get_free_loops", "buffer", "Total loops in LRU get free.",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_LRU_GET_FREE_LOOPS},
{"buffer_LRU_get_free_waits", "buffer",
"Total sleep waits in LRU get free.", MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_LRU_GET_FREE_WAITS},
{"buffer_flush_avg_page_rate", "buffer",
"Average number of pages at which flushing is happening", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_FLUSH_AVG_PAGE_RATE},
{"buffer_flush_lsn_avg_rate", "buffer", "Average redo generation rate",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_FLUSH_LSN_AVG_RATE},
{"buffer_flush_pct_for_dirty", "buffer",
"Percent of IO capacity used to avoid max dirty page limit", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_FLUSH_PCT_FOR_DIRTY},
{"buffer_flush_pct_for_lsn", "buffer",
"Percent of IO capacity used to avoid reusable redo space limit",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_FLUSH_PCT_FOR_LSN},
{"buffer_flush_sync_waits", "buffer",
"Number of times a wait happens due to sync flushing", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_FLUSH_SYNC_WAITS},
/* Cumulative counter for flush batches for adaptive flushing */
{"buffer_flush_adaptive_total_pages", "buffer",
"Total pages flushed as part of adaptive flushing", MONITOR_SET_OWNER,
MONITOR_FLUSH_ADAPTIVE_COUNT, MONITOR_FLUSH_ADAPTIVE_TOTAL_PAGE},
{"buffer_flush_adaptive", "buffer", "Number of adaptive batches",
MONITOR_SET_MEMBER, MONITOR_FLUSH_ADAPTIVE_TOTAL_PAGE,
MONITOR_FLUSH_ADAPTIVE_COUNT},
{"buffer_flush_adaptive_pages", "buffer",
"Pages queued as an adaptive batch", MONITOR_SET_MEMBER,
MONITOR_FLUSH_ADAPTIVE_TOTAL_PAGE, MONITOR_FLUSH_ADAPTIVE_PAGES},
/* Cumulative counter for flush batches because of sync */
{"buffer_flush_sync_total_pages", "buffer",
"Total pages flushed as part of sync batches", MONITOR_SET_OWNER,
MONITOR_FLUSH_SYNC_COUNT, MONITOR_FLUSH_SYNC_TOTAL_PAGE},
{"buffer_flush_sync", "buffer", "Number of sync batches",
MONITOR_SET_MEMBER, MONITOR_FLUSH_SYNC_TOTAL_PAGE,
MONITOR_FLUSH_SYNC_COUNT},
{"buffer_flush_sync_pages", "buffer", "Pages queued as a sync batch",
MONITOR_SET_MEMBER, MONITOR_FLUSH_SYNC_TOTAL_PAGE,
MONITOR_FLUSH_SYNC_PAGES},
/* Cumulative counter for flush batches because of background */
{"buffer_flush_background_total_pages", "buffer",
"Total pages flushed as part of background batches", MONITOR_SET_OWNER,
MONITOR_FLUSH_BACKGROUND_COUNT, MONITOR_FLUSH_BACKGROUND_TOTAL_PAGE},
{"buffer_flush_background", "buffer", "Number of background batches",
MONITOR_SET_MEMBER, MONITOR_FLUSH_BACKGROUND_TOTAL_PAGE,
MONITOR_FLUSH_BACKGROUND_COUNT},
{"buffer_flush_background_pages", "buffer",
"Pages queued as a background batch", MONITOR_SET_MEMBER,
MONITOR_FLUSH_BACKGROUND_TOTAL_PAGE, MONITOR_FLUSH_BACKGROUND_PAGES},
/* Cumulative counter for LRU batch scan */
{"buffer_LRU_batch_scanned", "buffer",
"Total pages scanned as part of LRU batch", MONITOR_SET_OWNER,
MONITOR_LRU_BATCH_SCANNED_NUM_CALL, MONITOR_LRU_BATCH_SCANNED},
{"buffer_LRU_batch_num_scan", "buffer",
"Number of times LRU batch is called", MONITOR_SET_MEMBER,
MONITOR_LRU_BATCH_SCANNED, MONITOR_LRU_BATCH_SCANNED_NUM_CALL},
{"buffer_LRU_batch_scanned_per_call", "buffer",
"Pages scanned per LRU batch call", MONITOR_SET_MEMBER,
MONITOR_LRU_BATCH_SCANNED, MONITOR_LRU_BATCH_SCANNED_PER_CALL},
/* Cumulative counter for LRU batch pages flushed */
{"buffer_LRU_batch_flush_total_pages", "buffer",
"Total pages flushed as part of LRU batches", MONITOR_SET_OWNER,
MONITOR_LRU_BATCH_FLUSH_COUNT, MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE},
{"buffer_LRU_batches_flush", "buffer", "Number of LRU batches",
MONITOR_SET_MEMBER, MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE,
MONITOR_LRU_BATCH_FLUSH_COUNT},
{"buffer_LRU_batch_flush_pages", "buffer", "Pages queued as an LRU batch",
MONITOR_SET_MEMBER, MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE,
MONITOR_LRU_BATCH_FLUSH_PAGES},
/* Cumulative counter for LRU batch pages flushed */
{"buffer_LRU_batch_evict_total_pages", "buffer",
"Total pages evicted as part of LRU batches", MONITOR_SET_OWNER,
MONITOR_LRU_BATCH_EVICT_COUNT, MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE},
{"buffer_LRU_batches_evict", "buffer", "Number of LRU batches",
MONITOR_SET_MEMBER, MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE,
MONITOR_LRU_BATCH_EVICT_COUNT},
{"buffer_LRU_batch_evict_pages", "buffer", "Pages queued as an LRU batch",
MONITOR_SET_MEMBER, MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE,
MONITOR_LRU_BATCH_EVICT_PAGES},
/* Cumulative counter for single page LRU scans */
{"buffer_LRU_single_flush_scanned", "buffer",
"Total pages scanned as part of single page LRU flush", MONITOR_SET_OWNER,
MONITOR_LRU_SINGLE_FLUSH_SCANNED_NUM_CALL,
MONITOR_LRU_SINGLE_FLUSH_SCANNED},
{"buffer_LRU_single_flush_num_scan", "buffer",
"Number of times single page LRU flush is called", MONITOR_SET_MEMBER,
MONITOR_LRU_SINGLE_FLUSH_SCANNED,
MONITOR_LRU_SINGLE_FLUSH_SCANNED_NUM_CALL},
{"buffer_LRU_single_flush_scanned_per_call", "buffer",
"Page scanned per single LRU flush", MONITOR_SET_MEMBER,
MONITOR_LRU_SINGLE_FLUSH_SCANNED,
MONITOR_LRU_SINGLE_FLUSH_SCANNED_PER_CALL},
{"buffer_LRU_single_flush_failure_count", "Buffer",
"Number of times attempt to flush a single page from LRU failed",
MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_LRU_SINGLE_FLUSH_FAILURE_COUNT},
{"buffer_LRU_get_free_search", "Buffer",
"Number of searches performed for a clean page", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_LRU_GET_FREE_SEARCH},
/* Cumulative counter for LRU search scans */
{"buffer_LRU_search_scanned", "buffer",
"Total pages scanned as part of LRU search", MONITOR_SET_OWNER,
MONITOR_LRU_SEARCH_SCANNED_NUM_CALL, MONITOR_LRU_SEARCH_SCANNED},
{"buffer_LRU_search_num_scan", "buffer",
"Number of times LRU search is performed", MONITOR_SET_MEMBER,
MONITOR_LRU_SEARCH_SCANNED, MONITOR_LRU_SEARCH_SCANNED_NUM_CALL},
{"buffer_LRU_search_scanned_per_call", "buffer",
"Page scanned per single LRU search", MONITOR_SET_MEMBER,
MONITOR_LRU_SEARCH_SCANNED, MONITOR_LRU_SEARCH_SCANNED_PER_CALL},
/* Cumulative counter for LRU unzip search scans */
{"buffer_LRU_unzip_search_scanned", "buffer",
"Total pages scanned as part of LRU unzip search", MONITOR_SET_OWNER,
MONITOR_LRU_UNZIP_SEARCH_SCANNED_NUM_CALL,
MONITOR_LRU_UNZIP_SEARCH_SCANNED},
{"buffer_LRU_unzip_search_num_scan", "buffer",
"Number of times LRU unzip search is performed", MONITOR_SET_MEMBER,
MONITOR_LRU_UNZIP_SEARCH_SCANNED,
MONITOR_LRU_UNZIP_SEARCH_SCANNED_NUM_CALL},
{"buffer_LRU_unzip_search_scanned_per_call", "buffer",
"Page scanned per single LRU unzip search", MONITOR_SET_MEMBER,
MONITOR_LRU_UNZIP_SEARCH_SCANNED,
MONITOR_LRU_UNZIP_SEARCH_SCANNED_PER_CALL},
/* ========== Counters for Buffer Page I/O ========== */
{"module_buffer_page", "buffer_page_io", "Buffer Page I/O Module",
static_cast<monitor_type_t>(MONITOR_MODULE | MONITOR_GROUP_MODULE),
MONITOR_DEFAULT_START, MONITOR_MODULE_BUF_PAGE},
/* MONITOR_INDEX_LEAF_PAGE_READ */
MONITOR_BUF_PAGE_READ("index_leaf", "Index Leaf", INDEX_LEAF),
/* MONITOR_INDEX_NON_LEAF_PAGE_READ */
MONITOR_BUF_PAGE_READ("index_non_leaf", "Index Non-leaf", INDEX_NON_LEAF),
/* MONITOR_INDEX_IBUF_LEAF_PAGE_READ */
MONITOR_BUF_PAGE_READ("index_ibuf_leaf", "Insert Buffer Index Leaf",
INDEX_IBUF_LEAF),
/* MONITOR_INDEX_IBUF_NON_LEAF_PAGE_READ */
MONITOR_BUF_PAGE_READ("index_ibuf_non_leaf", "Insert Buffer Index Non-Leaf",
INDEX_IBUF_NON_LEAF),
/* MONITOR_UNDO_LOG_PAGE_READ */
MONITOR_BUF_PAGE_READ("undo_log", "Undo Log", UNDO_LOG),
/* MONITOR_INODE_PAGE_READ */
MONITOR_BUF_PAGE_READ("index_inode", "Index Inode", INODE),
/* MONITOR_IBUF_FREELIST_PAGE_READ */
MONITOR_BUF_PAGE_READ("ibuf_free_list", "Insert Buffer Free List",
IBUF_FREELIST),
/* MONITOR_IBUF_BITMAP_PAGE_READ */
MONITOR_BUF_PAGE_READ("ibuf_bitmap", "Insert Buffer Bitmap", IBUF_BITMAP),
/* MONITOR_SYSTEM_PAGE_READ */
MONITOR_BUF_PAGE_READ("system_page", "System", SYSTEM),
/* MONITOR_TRX_SYSTEM_PAGE_READ */
MONITOR_BUF_PAGE_READ("trx_system", "Transaction System", TRX_SYSTEM),
/* MONITOR_FSP_HDR_PAGE_READ */
MONITOR_BUF_PAGE_READ("fsp_hdr", "File Space Header", FSP_HDR),
/* MONITOR_XDES_PAGE_READ */
MONITOR_BUF_PAGE_READ("xdes", "Extent Descriptor", XDES),
/* MONITOR_BLOB_PAGE_READ */
MONITOR_BUF_PAGE_READ("blob", "Uncompressed BLOB", BLOB),
/* MONITOR_ZBLOB_PAGE_READ */
MONITOR_BUF_PAGE_READ("zblob", "First Compressed BLOB", ZBLOB),
/* MONITOR_ZBLOB2_PAGE_READ */
MONITOR_BUF_PAGE_READ("zblob2", "Subsequent Compressed BLOB", ZBLOB2),
/* MONITOR_RSEG_ARRAY_PAGE_READ */
MONITOR_BUF_PAGE_READ("rseg_array", "Rollback Segment Array", RSEG_ARRAY),
/* MONITOR_OTHER_PAGE_READ */
MONITOR_BUF_PAGE_READ("other", "other/unknown (old version of InnoDB)",
OTHER),
/* MONITOR_INDEX_LEAF_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("index_leaf", "Index Leaf", INDEX_LEAF),
/* MONITOR_INDEX_NON_LEAF_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("index_non_leaf", "Index Non-leaf",
INDEX_NON_LEAF),
/* MONITOR_INDEX_IBUF_LEAF_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("index_ibuf_leaf", "Insert Buffer Index Leaf",
INDEX_IBUF_LEAF),
/*MONITOR_INDEX_IBUF_NON_LEAF_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("index_ibuf_non_leaf",
"Insert Buffer Index Non-Leaf",
INDEX_IBUF_NON_LEAF),
/* MONITOR_UNDO_LOG_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("undo_log", "Undo Log", UNDO_LOG),
/* MONITOR_INODE_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("index_inode", "Index Inode", INODE),
/* MONITOR_IBUF_FREELIST_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("ibuf_free_list", "Insert Buffer Free List",
IBUF_FREELIST),
/* MONITOR_IBUF_BITMAP_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("ibuf_bitmap", "Insert Buffer Bitmap",
IBUF_BITMAP),
/* MONITOR_SYSTEM_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("system_page", "System", SYSTEM),
/* MONITOR_TRX_SYSTEM_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("trx_system", "Transaction System", TRX_SYSTEM),
/* MONITOR_FSP_HDR_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("fsp_hdr", "File Space Header", FSP_HDR),
/* MONITOR_XDES_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("xdes", "Extent Descriptor", XDES),
/* MONITOR_BLOB_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("blob", "Uncompressed BLOB", BLOB),
/* MONITOR_ZBLOB_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("zblob", "First Compressed BLOB", ZBLOB),
/* MONITOR_ZBLOB2_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("zblob2", "Subsequent Compressed BLOB", ZBLOB2),
/* MONITOR_RSEG_ARRAY_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("rseg_array", "Rollback Segment Array",
RSEG_ARRAY),
/* MONITOR_OTHER_PAGE_WRITTEN */
MONITOR_BUF_PAGE_WRITTEN("other", "other/unknown (old version InnoDB)",
OTHER),
MONITOR_BUF_PAGE_WRITTEN_WAIT_STATS(
"on_log_", "Waits on redo flushed when flushing pages", ON_LOG_),
/* ========== Counters for OS level operations ========== */
{"module_os", "os", "OS Level Operation", MONITOR_MODULE,
MONITOR_DEFAULT_START, MONITOR_MODULE_OS},
{"os_data_reads", "os", "Number of reads initiated (innodb_data_reads)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_OS_FILE_READ},
{"os_data_writes", "os", "Number of writes initiated (innodb_data_writes)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_OS_FILE_WRITE},
{"os_data_fsyncs", "os", "Number of fsync() calls (innodb_data_fsyncs)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_OS_FSYNC},
{"os_pending_reads", "os", "Number of reads pending", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OS_PENDING_READS},
{"os_pending_writes", "os", "Number of writes pending", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_OS_PENDING_WRITES},
{"os_log_bytes_written", "os",
"Bytes of log written (innodb_os_log_written)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_OS_LOG_WRITTEN},
{"os_log_fsyncs", "os", "Number of fsync log writes (innodb_os_log_fsyncs)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_OS_LOG_FSYNC},
{"os_log_pending_fsyncs", "os",
"Number of pending fsync write (innodb_os_log_pending_fsyncs)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_OS_LOG_PENDING_FSYNC},
{"os_log_pending_writes", "os",
"Number of pending log file writes (innodb_os_log_pending_writes)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_OS_LOG_PENDING_WRITES},
/* ========== Counters for Transaction Module ========== */
{"module_trx", "transaction", "Transaction Manager", MONITOR_MODULE,
MONITOR_DEFAULT_START, MONITOR_MODULE_TRX},
{"trx_rw_commits", "transaction",
"Number of read-write transactions committed", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_TRX_RW_COMMIT},
{"trx_ro_commits", "transaction",
"Number of read-only transactions committed", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_TRX_RO_COMMIT},
{"trx_nl_ro_commits", "transaction",
"Number of non-locking auto-commit read-only transactions committed",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_TRX_NL_RO_COMMIT},
{"trx_commits_insert_update", "transaction",
"Number of transactions committed with inserts and updates", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_TRX_COMMIT_UNDO},
{"trx_rollbacks", "transaction", "Number of transactions rolled back",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_TRX_ROLLBACK},
{"trx_rollbacks_savepoint", "transaction",
"Number of transactions rolled back to savepoint", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_TRX_ROLLBACK_SAVEPOINT},
{"trx_rollback_active", "transaction",
"Number of resurrected active transactions rolled back", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_TRX_ROLLBACK_ACTIVE},
{"trx_active_transactions", "transaction", "Number of active transactions",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_TRX_ACTIVE},
{"trx_allocations", "transaction", "Number of trx_t allocations",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_TRX_ALLOCATIONS},
MONITOR_WAIT_STATS("trx_on_log_", "transaction",
"Waits for redo during transaction commits",
MONITOR_TRX_ON_LOG_),
{"trx_rseg_history_len", "transaction",
"Length of the TRX_RSEG_HISTORY list",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT |
MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_RSEG_HISTORY_LEN},
{"trx_undo_slots_used", "transaction", "Number of undo slots used",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_NUM_UNDO_SLOT_USED},
{"trx_undo_slots_cached", "transaction", "Number of undo slots cached",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_NUM_UNDO_SLOT_CACHED},
{"trx_rseg_current_size", "transaction",
"Current rollback segment size in pages",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_RSEG_CUR_SIZE},
/* ========== Counters for Purge Module ========== */
{"module_purge", "purge", "Purge Module", MONITOR_MODULE,
MONITOR_DEFAULT_START, MONITOR_MODULE_PURGE},
{"purge_del_mark_records", "purge", "Number of delete-marked rows purged",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_N_DEL_ROW_PURGE},
{"purge_upd_exist_or_extern_records", "purge",
"Number of purges on updates of existing records and"
" updates on delete marked record with externally stored field",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_N_UPD_EXIST_EXTERN},
{"purge_invoked", "purge", "Number of times purge was invoked",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_PURGE_INVOKED},
{"purge_undo_log_pages", "purge",
"Number of undo log pages handled by the purge", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_PURGE_N_PAGE_HANDLED},
{"purge_dml_delay_usec", "purge",
"Microseconds DML to be delayed due to purge lagging",
MONITOR_DISPLAY_CURRENT, MONITOR_DEFAULT_START, MONITOR_DML_PURGE_DELAY},
{"purge_stop_count", "purge", "Number of times purge was stopped",
MONITOR_DISPLAY_CURRENT, MONITOR_DEFAULT_START, MONITOR_PURGE_STOP_COUNT},
{"purge_resume_count", "purge", "Number of times purge was resumed",
MONITOR_DISPLAY_CURRENT, MONITOR_DEFAULT_START,
MONITOR_PURGE_RESUME_COUNT},
{"purge_truncate_history_count", "purge",
"Number of times the purge thread attempted to truncate undo history",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_PURGE_TRUNCATE_HISTORY_COUNT},
{"purge_truncate_history_usec", "purge",
"Time (in microseconds) the purge thread spent truncating undo history.",
MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_PURGE_TRUNCATE_HISTORY_MICROSECOND},
/* ========== Counters for Undo Tablespace Truncation ========== */
{"module_undo", "undo", "Undo Truncation", MONITOR_MODULE,
MONITOR_DEFAULT_START, MONITOR_UNDO_TRUNCATE},
{"undo_truncate_count", "undo",
"Number of times undo truncation was initiated", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_UNDO_TRUNCATE_COUNT},
{"undo_truncate_start_logging_count", "undo",
"Number of times during undo truncation a log file was started",
MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_UNDO_TRUNCATE_START_LOGGING_COUNT},
{"undo_truncate_done_logging_count", "undo",
"Number of times during undo truncation a log file was deleted",
MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_UNDO_TRUNCATE_DONE_LOGGING_COUNT},
{"undo_truncate_usec", "undo",
"Time (in microseconds) spent to process undo truncation", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_UNDO_TRUNCATE_MICROSECOND},
/* ========== Counters for Redo log Module ========== */
{"module_log", "log", "Redo log Module", MONITOR_MODULE,
MONITOR_DEFAULT_START, MONITOR_MODULE_REDO_LOG},
{"log_lsn_last_flush", "log", "LSN of last flush",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_OVLD_LSN_FLUSHDISK},
{"log_lsn_last_checkpoint", "log", "LSN at last checkpoint",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_OVLD_LSN_CHECKPOINT},
{"log_lsn_current", "log", "Current LSN value",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_OVLD_LSN_CURRENT},
{"log_lsn_archived", "log", "Archived LSN value",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_OVLD_LSN_ARCHIVED},
{"log_lsn_checkpoint_age", "log",
"Current LSN value minus LSN at last checkpoint",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_OVLD_LSN_CHECKPOINT_AGE},
{"log_lsn_buf_dirty_pages_added", "log",
"The LSN value up to which all dirty pages have been added",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_OVLD_LSN_BUF_DIRTY_PAGES_ADDED},
{"log_lsn_buf_pool_oldest_approx", "log",
"Approximation for the oldest modified block LSN in the buffer pool",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_OLDEST_LSN_APPROX},
{"log_lsn_buf_pool_oldest_lwm", "log",
"Low watermark for the oldest modified block LSN in the buffer pool",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_OVLD_BUF_OLDEST_LSN_LWM},
{"log_max_modified_age_async", "log",
"Maximum LSN difference; when exceeded, start asynchronous preflush",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_OVLD_MAX_AGE_ASYNC},
{"log_max_modified_age_sync", "log",
"Maximum LSN difference; when exceeded, start synchronous preflush",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT),
MONITOR_DEFAULT_START, MONITOR_OVLD_MAX_AGE_SYNC},
{"log_waits", "log",
"Number of log waits due to small log buffer (innodb_log_waits)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_LOG_WAITS},
{"log_write_requests", "log",
"Number of log write requests (innodb_log_write_requests)",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_LOG_WRITE_REQUEST},
{"log_writes", "log", "Number of log writes",
static_cast<monitor_type_t>(MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_LOG_WRITES},
{"log_flush_total_time", "log", "Total time spent on fsync for log files",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_LOG_FLUSH_TOTAL_TIME},
{"log_flush_max_time", "log",
"Maximum time spent on fsync for log files (during last "
"innodb_flushing_avg_loops)",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_LOG_FLUSH_MAX_TIME},
{"log_flush_avg_time", "log",
"Average time spent on fsync for log files (during last "
"innodb_flushing_avg_loops)",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_LOG_FLUSH_AVG_TIME},
{"log_flush_lsn_avg_rate", "log",
"Average redo flushing rate (during last innodb_flushing_avg_loops)",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_LOG_FLUSH_LSN_AVG_RATE},
{"log_full_block_writes", "log",
"Number of log writes for full (completed) log blocks", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_LOG_FULL_BLOCK_WRITES},
{"log_partial_block_writes", "log",
"Number of log writes for partial (incomplete) log blocks", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_LOG_PARTIAL_BLOCK_WRITES},
{"log_padded", "log", "Bytes of log padded for log write ahead",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_LOG_PADDED},
{"log_next_file", "log", "Number of new log files created.", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_LOG_NEXT_FILE},
{"log_checkpoints", "log", "Number of checkpoints", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_LOG_CHECKPOINTS},
{"log_free_space", "log", "Free space in redo (emergency when negative).",
MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_LOG_FREE_SPACE},
{"log_concurrency_margin", "log",
"Current concurrency margin used (may increase).", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_LOG_CONCURRENCY_MARGIN},
MONITOR_WAIT_STATS("log_writer_", "log",
"Waits on task in log_writer thread",
MONITOR_LOG_WRITER_),
{"log_writer_on_file_space_waits", "log",
"Waits on free space in log writer", MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_LOG_WRITER_ON_FREE_SPACE_WAITS},
{"log_writer_on_archiver_waits", "log",
"Waits on redo archiver in log writer", MONITOR_NONE,
MONITOR_DEFAULT_START, MONITOR_LOG_WRITER_ON_ARCHIVER_WAITS},
MONITOR_WAIT_STATS("log_flusher_", "log",
"Waits on task in log_flusher thread",
MONITOR_LOG_FLUSHER_),
MONITOR_WAIT_STATS("log_write_notifier_", "log",
"Waits on task in log_write_notifier thread",
MONITOR_LOG_WRITE_NOTIFIER_),
MONITOR_WAIT_STATS("log_flush_notifier_", "log",
"Waits on task in log_flush_notifier_thread",
MONITOR_LOG_FLUSH_NOTIFIER_),
{"log_write_to_file_requests_interval", "log",
"Average time between consecutive requests to write/flush redo."
" Measured only for requests signaled during commit of transactions.",
MONITOR_NONE, MONITOR_DEFAULT_START,
MONITOR_LOG_WRITE_TO_FILE_REQUESTS_INTERVAL},