MySQL 8.0.39
Source Code Documentation
srv0mon.h
Go to the documentation of this file.
1/***********************************************************************
2
3Copyright (c) 2010, 2024, Oracle and/or its affiliates.
4Copyright (c) 2012, Facebook Inc.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License, version 2.0,
8as published by the Free Software Foundation.
9
10This program is designed to work with certain software (including
11but not limited to OpenSSL) that is licensed under separate terms,
12as designated in a particular file or component or in included license
13documentation. The authors of MySQL hereby grant you an additional
14permission to link the program and your derivative works with the
15separately licensed software that they have either included with
16the program or referenced in the documentation.
17
18This program is distributed in the hope that it will be useful,
19but WITHOUT ANY WARRANTY; without even the implied warranty of
20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21GNU General Public License, version 2.0, for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; if not, write to the Free Software
25Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
27***********************************************************************/
28
29/** @file include/srv0mon.h
30 Server monitor counter related defines
31
32 Created 12/15/2009 Jimmy Yang
33 *******************************************************/
34
35#ifndef srv0mon_h
36#define srv0mon_h
37
38#include "univ.i"
39
40#ifndef __STDC_LIMIT_MACROS
41/* Required for FreeBSD so that INT64_MAX is defined. */
42#define __STDC_LIMIT_MACROS
43#endif /* __STDC_LIMIT_MACROS */
44
45#include <stdint.h>
46
47/** Possible status values for "mon_status" in "struct monitor_value" */
49 MONITOR_STARTED = 1, /*!< Monitor has been turned on */
50 MONITOR_STOPPED = 2 /*!< Monitor has been turned off */
51};
52
54
55/** Monitor counter value type */
56typedef int64_t mon_type_t;
57
58/** Two monitor structures are defined in this file. One is
59"monitor_value_t" which contains dynamic counter values for each
60counter. The other is "monitor_info_t", which contains
61static information (counter name, desc etc.) for each counter.
62In addition, an enum datatype "monitor_id_t" is also defined,
63it identifies each monitor with an internally used symbol, whose
64integer value indexes into above two structure for its dynamic
65and static information.
66Developer who intend to add new counters would require to
67fill in counter information as described in "monitor_info_t" and
68create the internal counter ID in "monitor_id_t". */
69
70/** Structure containing the actual values of a monitor counter. */
72 std::chrono::system_clock::time_point
73 mon_start_time; /*!< Start time of monitoring */
74 std::chrono::system_clock::time_point
75 mon_stop_time; /*!< Stop time of monitoring */
76 std::chrono::system_clock::time_point
77 mon_reset_time; /*!< Time counter was reset */
78 std::atomic<mon_type_t> mon_value; /*!< Current counter Value */
79 mon_type_t mon_max_value; /*!< Current Max value */
80 mon_type_t mon_min_value; /*!< Current Min value */
81 mon_type_t mon_value_reset; /*!< value at last reset */
82 mon_type_t mon_max_value_start; /*!< Max value since start */
83 mon_type_t mon_min_value_start; /*!< Min value since start */
84 mon_type_t mon_start_value; /*!< Value at the start time */
85 mon_type_t mon_last_value; /*!< Last set of values */
86 monitor_running_t mon_status; /* whether monitor still running */
87};
88
89/** Following defines are possible values for "monitor_type" field in
90"struct monitor_info" */
92 MONITOR_NONE = 0, /*!< No monitoring */
93 MONITOR_MODULE = 1, /*!< This is a monitor module type,
94 not a counter */
95 MONITOR_EXISTING = 2, /*!< The monitor carries information from
96 an existing system status variable */
97 MONITOR_NO_AVERAGE = 4, /*!< Set this status if we don't want to
98 calculate the average value for the counter */
99 MONITOR_DISPLAY_CURRENT = 8, /*!< Display current value of the
100 counter, rather than incremental value
101 over the period. Mostly for counters
102 displaying current resource usage */
103 MONITOR_GROUP_MODULE = 16, /*!< Monitor can be turned on/off
104 only as a module, but not individually */
105 MONITOR_DEFAULT_ON = 32, /*!< Monitor will be turned on by default at
106 server start up */
107 MONITOR_SET_OWNER = 64, /*!< Owner of "monitor set", a set of
108 monitor counters */
109 MONITOR_SET_MEMBER = 128, /*!< Being part of a "monitor set" */
110 MONITOR_HIDDEN = 256 /*!< Do not display this monitor in the
111 metrics table */
113
114/** Counter minimum value is initialized to be max value of
115 mon_type_t (int64_t) */
116#define MIN_RESERVED INT64_MAX
117#define MAX_RESERVED (~MIN_RESERVED)
118
119/** This enumeration defines internal monitor identifier used internally
120to identify each particular counter. Its value indexes into two arrays,
121one is the "innodb_counter_value" array which records actual monitor
122counter values, the other is "innodb_counter_info" array which describes
123each counter's basic information (name, desc etc.). A couple of
124naming rules here:
1251) If the monitor defines a module, it starts with MONITOR_MODULE
1262) If the monitor uses existing counters from "status variable", its ID
127name shall start with MONITOR_OVLD
128
129Please refer to "innodb_counter_info" in srv/srv0mon.cc for detail
130information for each monitor counter */
131
133 /* This is to identify the default value set by the metrics
134 control global variables */
136
137 /* Start of Metadata counter */
142
143 /* Lock manager related counters */
167
168 /* Buffer and I/O related counters. */
200
204
210
214
217
252
253 /* Buffer Page I/O specific counters. */
292
293 /* OS level counters (I/O) */
304
305 /* Transaction related counters */
323
324 /* Purge related counters */
335
336 /* Undo tablespace truncation */
342
343 /* Recovery related counters */
358
363
371
377
381
385
389
391
406
407 /* Page Manager related counters */
413
414 /* Index related counters */
422
423 /* Adaptive Hash Index related counters */
433
434 /* Tablespace related counters */
437
438 /* InnoDB Change Buffer related counters */
448
449 /* Counters for server operations */
473
474 /* Data DML related counters */
484
485 /* Sampling related counters */
489
490 /* Data DDL related counters */
497
503
504 /* Mutex/RW-Lock related counters */
507
508 /* CPU usage information */
515
521
527
528 /* This is used only for control system to turn
529 on/off and reset all monitor counters */
531
532 /* This must be the last member */
535
536/** This informs the monitor control system to turn
537on/off and reset monitor counters through wild card match */
538#define MONITOR_WILDCARD_MATCH (NUM_MONITOR + 1)
539
540/** Cannot find monitor counter with a specified name */
541#define MONITOR_NO_MATCH (NUM_MONITOR + 2)
542
543/** struct monitor_info describes the basic/static information
544about each monitor counter. */
546 const char *monitor_name; /*!< Monitor name */
547 const char *monitor_module; /*!< Sub Module the monitor
548 belongs to */
549 const char *monitor_desc; /*!< Brief desc of monitor counter */
550 monitor_type_t monitor_type; /*!< Type of Monitor Info */
551 monitor_id_t monitor_related_id; /*!< Monitor ID of counter that
552 related to this monitor. This is
553 set when the monitor belongs to
554 a "monitor set" */
555 monitor_id_t monitor_id; /*!< Monitor ID as defined in enum
556 monitor_id_t */
557};
558
559/** Following are the "set_option" values allowed for
560srv_mon_process_existing_counter() and srv_mon_process_existing_counter()
561functions. To turn on/off/reset the monitor counters. */
563 MONITOR_TURN_ON = 1, /*!< Turn on the counter */
564 MONITOR_TURN_OFF, /*!< Turn off the counter */
565 MONITOR_RESET_VALUE, /*!< Reset current values */
566 MONITOR_RESET_ALL_VALUE, /*!< Reset all values */
567 MONITOR_GET_VALUE /*!< Option for
568 srv_mon_process_existing_counter()
569 function */
571
572#ifndef UNIV_HOTBACKUP
573/** Number of bit in a ulint datatype */
574#define NUM_BITS_ULINT (sizeof(ulint) * CHAR_BIT)
575
576/** This "monitor_set_tbl" is a bitmap records whether a particular monitor
577counter has been turned on or off */
578extern ulint
580
581/** Macros to turn on/off the control bit in monitor_set_tbl for a monitor
582counter option. */
583#define MONITOR_ON(monitor) \
584 (monitor_set_tbl[monitor / NUM_BITS_ULINT] |= \
585 ((ulint)1 << (monitor % NUM_BITS_ULINT)))
586
587#define MONITOR_OFF(monitor) \
588 (monitor_set_tbl[monitor / NUM_BITS_ULINT] &= \
589 ~((ulint)1 << (monitor % NUM_BITS_ULINT)))
590
591/** Check whether the requested monitor is turned on/off */
592#define MONITOR_IS_ON(monitor) \
593 (monitor_set_tbl[monitor / NUM_BITS_ULINT] & \
594 ((ulint)1 << (monitor % NUM_BITS_ULINT)))
595
596/** The actual monitor counter array that records each monitor counter
597value */
599
600/** Following are macro defines for basic monitor counter manipulations.
601Please note we do not provide any synchronization for these monitor
602operations due to performance consideration. Most counters can
603be placed under existing mutex protections in respective code
604module. */
605
606/** Macros to access various fields of a monitor counters */
607#define MONITOR_FIELD(monitor, field) (innodb_counter_value[monitor].field)
608
609#define MONITOR_VALUE(monitor) MONITOR_FIELD(monitor, mon_value)
610
611#define MONITOR_MAX_VALUE(monitor) MONITOR_FIELD(monitor, mon_max_value)
612
613#define MONITOR_MIN_VALUE(monitor) MONITOR_FIELD(monitor, mon_min_value)
614
615#define MONITOR_VALUE_RESET(monitor) MONITOR_FIELD(monitor, mon_value_reset)
616
617#define MONITOR_MAX_VALUE_START(monitor) \
618 MONITOR_FIELD(monitor, mon_max_value_start)
619
620#define MONITOR_MIN_VALUE_START(monitor) \
621 MONITOR_FIELD(monitor, mon_min_value_start)
622
623#define MONITOR_LAST_VALUE(monitor) MONITOR_FIELD(monitor, mon_last_value)
624
625#define MONITOR_START_VALUE(monitor) MONITOR_FIELD(monitor, mon_start_value)
626
627#define MONITOR_VALUE_SINCE_START(monitor) \
628 (MONITOR_VALUE(monitor) + MONITOR_VALUE_RESET(monitor))
629
630#define MONITOR_STATUS(monitor) MONITOR_FIELD(monitor, mon_status)
631
632#define MONITOR_SET_START(monitor) \
633 do { \
634 MONITOR_STATUS(monitor) = MONITOR_STARTED; \
635 MONITOR_FIELD((monitor), mon_start_time) = \
636 std::chrono::system_clock::now(); \
637 } while (0)
638
639#define MONITOR_SET_OFF(monitor) \
640 do { \
641 MONITOR_STATUS(monitor) = MONITOR_STOPPED; \
642 MONITOR_FIELD((monitor), mon_stop_time) = \
643 std::chrono::system_clock::now(); \
644 } while (0)
645
646#define MONITOR_INIT_ZERO_VALUE 0
647
648/** Max and min values are initialized when we first turn on the monitor
649counter, and set the MONITOR_STATUS. */
650#define MONITOR_MAX_MIN_NOT_INIT(monitor) \
651 (MONITOR_STATUS(monitor) == MONITOR_INIT_ZERO_VALUE && \
652 MONITOR_MIN_VALUE(monitor) == MONITOR_INIT_ZERO_VALUE && \
653 MONITOR_MAX_VALUE(monitor) == MONITOR_INIT_ZERO_VALUE)
654
655#define MONITOR_INIT(monitor) \
656 if (MONITOR_MAX_MIN_NOT_INIT(monitor)) { \
657 MONITOR_MIN_VALUE(monitor) = MIN_RESERVED; \
658 MONITOR_MIN_VALUE_START(monitor) = MIN_RESERVED; \
659 MONITOR_MAX_VALUE(monitor) = MAX_RESERVED; \
660 MONITOR_MAX_VALUE_START(monitor) = MAX_RESERVED; \
661 }
662
663#ifdef UNIV_DEBUG_VALGRIND
664#define MONITOR_CHECK_DEFINED(value) \
665 do { \
666 UNIV_MEM_ASSERT_RW(&value, sizeof value); \
667 } while (0)
668#else /* UNIV_DEBUG_VALGRIND */
669#define MONITOR_CHECK_DEFINED(value) (void)0
670#endif /* UNIV_DEBUG_VALGRIND */
671
672/** Macros to increment/decrement the counters. The normal
673monitor counter operation expects appropriate synchronization
674already exists. No additional mutex is necessary when operating
675on the counters */
676#define MONITOR_INC(monitor) monitor_inc_value(monitor, 1)
677#define MONITOR_DEC(monitor) monitor_dec(monitor)
678#define MONITOR_INC_VALUE(monitor, value) monitor_inc_value(monitor, value)
679#define MONITOR_DEC_VALUE(monitor, value) monitor_dec_value(monitor, value)
680
681/* Increment/decrement counter without check the monitor on/off bit, which
682could already be checked as a module group */
683#define MONITOR_INC_NOCHECK(monitor) monitor_inc_value_nocheck(monitor, 1)
684#define MONITOR_DEC_NOCHECK(monitor) monitor_dec_value_nocheck(monitor, 1)
685
686/** Atomically increment a monitor counter.
687Use MONITOR_INC if appropriate mutex protection exists.
688@param monitor monitor to be incremented by 1 */
689#define MONITOR_ATOMIC_INC(monitor) monitor_atomic_inc(monitor, 1)
690
691#define MONITOR_ATOMIC_INC_VALUE(monitor, value) \
692 monitor_atomic_inc(monitor, value)
693
694/** Atomically decrement a monitor counter.
695Use MONITOR_DEC if appropriate mutex protection exists.
696@param monitor monitor to be decremented by 1 */
697#define MONITOR_ATOMIC_DEC(monitor) monitor_atomic_dec(monitor)
698
699inline void monitor_set_max_value(monitor_id_t monitor, mon_type_t value) {
700 if (value > MONITOR_MAX_VALUE(monitor)) {
701 MONITOR_MAX_VALUE(monitor) = value;
702 }
703}
704
705inline void monitor_set_min_value(monitor_id_t monitor, mon_type_t value) {
706 if (value < MONITOR_MIN_VALUE(monitor)) {
707 MONITOR_MIN_VALUE(monitor) = value;
708 }
709}
710
711inline void monitor_atomic_inc(monitor_id_t monitor, mon_type_t inc_value) {
712 if (MONITOR_IS_ON(monitor)) {
713 const mon_type_t value =
714 MONITOR_VALUE(monitor).fetch_add(inc_value) + inc_value;
715 /* Note: This is not 100% accurate because of the inherent race, we ignore
716 it due to performance. */
717 monitor_set_max_value(monitor, value);
718 }
719}
720
721inline void monitor_atomic_dec(monitor_id_t monitor) {
722 if (MONITOR_IS_ON(monitor)) {
723 const mon_type_t value = --MONITOR_VALUE(monitor);
724 /* Note: This is not 100% accurate because of the inherent race, we ignore
725 it due to performance. */
726 monitor_set_min_value(monitor, value);
727 }
728}
729
731 bool set_max = true) {
732 /* We use std::memory_order_relaxed load() and store() as two separate steps,
733 instead of single atomic fetch_add operation, because we want to leave it
734 non-atomic as it was before changing mon_value to std::atomic.*/
735 const auto new_value =
736 MONITOR_VALUE(monitor).load(std::memory_order_relaxed) + value;
737 MONITOR_VALUE(monitor).store(new_value, std::memory_order_relaxed);
738 if (set_max) {
739 monitor_set_max_value(monitor, new_value);
740 }
741}
742
743inline void monitor_inc_value(monitor_id_t monitor, mon_type_t value) {
745 if (MONITOR_IS_ON(monitor)) {
746 monitor_inc_value_nocheck(monitor, value);
747 }
748}
749
751 /* We use std::memory_order_relaxed load() and store() as two separate steps,
752 instead of single atomic fetch_sub operation, because we want to leave it
753 non-atomic as it was before changing mon_value to std::atomic.*/
754 const auto new_value =
755 MONITOR_VALUE(monitor).load(std::memory_order_relaxed) - value;
756 MONITOR_VALUE(monitor).store(new_value, std::memory_order_relaxed);
757 monitor_set_min_value(monitor, new_value);
758}
759
760inline void monitor_dec_value(monitor_id_t monitor, mon_type_t value) {
762 if (MONITOR_IS_ON(monitor)) {
763 ut_ad(MONITOR_VALUE(monitor) >= value);
764 monitor_dec_value_nocheck(monitor, value);
765 }
766}
767
768inline void monitor_dec(monitor_id_t monitor) {
769 if (MONITOR_IS_ON(monitor)) {
770 monitor_dec_value_nocheck(monitor, 1);
771 }
772}
773
774/** Directly set a monitor counter's value */
775#define MONITOR_SET(monitor, value) monitor_set(monitor, value, true, true)
776
777/** Sets a value to the monitor counter
778@param monitor monitor to update
779@param value value to set
780@param set_max says whether to update MONITOR_MAX_VALUE
781@param set_min says whether to update MONITOR_MIN_VALUE */
782inline void monitor_set(monitor_id_t monitor, mon_type_t value, bool set_max,
783 bool set_min) {
785 if (MONITOR_IS_ON(monitor)) {
786 MONITOR_VALUE(monitor).store(value, std::memory_order_relaxed);
787 if (set_max) {
788 monitor_set_max_value(monitor, value);
789 }
790 if (set_min) {
791 monitor_set_min_value(monitor, value);
792 }
793 }
794}
795
796/** Add time difference between now and input "value" to the monitor counter
797@param monitor monitor to update for the time difference
798@param value the start time value */
799#define MONITOR_INC_TIME(monitor, value) monitor_inc_time(monitor, value)
800
801inline void monitor_inc_time(monitor_id_t monitor,
802 std::chrono::steady_clock::time_point value) {
804 if (MONITOR_IS_ON(monitor)) {
805 const mon_type_t new_value =
806 MONITOR_VALUE(monitor).load(std::memory_order_relaxed) +
807 std::chrono::duration_cast<std::chrono::microseconds>(
808 std::chrono::steady_clock::now() - value)
809 .count();
810 MONITOR_VALUE(monitor).store(new_value, std::memory_order_relaxed);
811 }
812}
813
814/** This macro updates 3 counters in one call. However, it only checks the
815main/first monitor counter 'monitor', to see it is on or off to decide
816whether to do the update.
817@param monitor the main monitor counter to update. It accounts for
818 the accumulative value for the counter.
819@param monitor_n_calls counter that counts number of times this macro is
820 called
821@param monitor_per_call counter that records the current and max value of
822 each incremental value
823@param value incremental value to record this time */
824#define MONITOR_INC_VALUE_CUMULATIVE(monitor, monitor_n_calls, \
825 monitor_per_call, value) \
826 monitor_inc_value_cumulative(monitor, monitor_n_calls, monitor_per_call, \
827 value)
828
830 monitor_id_t monitor_n_calls,
831 monitor_id_t monitor_per_call,
832 mon_type_t value) {
834 if (MONITOR_IS_ON(monitor)) {
835 monitor_inc_value_nocheck(monitor_n_calls, 1, false);
836 monitor_set(monitor_per_call, value, true, false);
837 monitor_inc_value_nocheck(monitor, value);
838 }
839}
840
841/** Directly set a monitor counter's value, and if the value
842is monotonically increasing, only max value needs to be updated */
843#define MONITOR_SET_UPD_MAX_ONLY(monitor, value) \
844 monitor_set(monitor, value, true, false)
845
846/** Some values such as log sequence number are monotonically increasing
847number, do not need to record max/min values */
848#define MONITOR_SET_SIMPLE(monitor, value) \
849 monitor_set(monitor, value, false, false)
850
851/** Reset the monitor value and max/min value to zero. The reset
852operation would only be conducted when the counter is turned off */
853#define MONITOR_RESET_ALL(monitor) monitor_reset_all(monitor)
854
855inline void monitor_reset_all(monitor_id_t monitor) {
857 std::memory_order_relaxed);
864 MONITOR_FIELD(monitor, mon_start_time) = {};
865 MONITOR_FIELD(monitor, mon_stop_time) = {};
866 MONITOR_FIELD(monitor, mon_reset_time) = {};
867}
868
869/** Following four macros defines necessary operations to fetch and
870consolidate information from existing system status variables. */
871
872/** Save the passed-in value to mon_start_value field of monitor
873counters */
874#define MONITOR_SAVE_START(monitor, value) \
875 do { \
876 MONITOR_CHECK_DEFINED(value); \
877 (MONITOR_START_VALUE(monitor) = \
878 (mon_type_t)(value)-MONITOR_VALUE_RESET(monitor)); \
879 } while (0)
880
881/** Save the passed-in value to mon_last_value field of monitor
882counters */
883#define MONITOR_SAVE_LAST(monitor) monitor_save_last(monitor)
884
885inline void monitor_save_last(monitor_id_t monitor) {
886 const auto value = MONITOR_VALUE(monitor).load(std::memory_order_relaxed);
887 MONITOR_LAST_VALUE(monitor) = value;
888 MONITOR_START_VALUE(monitor) += value;
889}
890
891/** Set monitor value to the difference of value and mon_start_value
892compensated by mon_last_value if accumulated value is required. */
893#define MONITOR_SET_DIFF(monitor, value) \
894 MONITOR_SET_UPD_MAX_ONLY(monitor, ((value)-MONITOR_VALUE_RESET(monitor) - \
895 MONITOR_FIELD(monitor, mon_start_value) + \
896 MONITOR_FIELD(monitor, mon_last_value)))
897
898/** Get monitor's monitor_info_t by its monitor id (index into the
899 innodb_counter_info array
900 @return Point to corresponding monitor_info_t, or NULL if no such
901 monitor */
903 monitor_id_t monitor_id); /*!< id index into the
904 innodb_counter_info array */
905/** Get monitor's name by its monitor id (index into the
906 innodb_counter_info array
907 @return corresponding monitor name, or NULL if no such
908 monitor */
909const char *srv_mon_get_name(
910 monitor_id_t monitor_id); /*!< id index into the
911 innodb_counter_info array */
912
913/** Turn on/off/reset monitor counters in a module. If module_value
914 is NUM_MONITOR then turn on all monitor counters. */
916 monitor_id_t module_id, /*!< in: Module ID as in
917 monitor_counter_id. If it is
918 set to NUM_MONITOR, this means
919 we shall turn on all the counters */
920 mon_option_t set_option); /*!< in: Turn on/off reset the
921 counter */
922/** This function consolidates some existing server counters used
923 by "system status variables". These existing system variables do not have
924 mechanism to start/stop and reset the counters, so we simulate these
925 controls by remembering the corresponding counter values when the
926 corresponding monitors are turned on/off/reset, and do appropriate
927 mathematics to deduct the actual value. */
929 monitor_id_t monitor_id, /*!< in: the monitor's ID as in
930 monitor_counter_id */
931 mon_option_t set_option); /*!< in: Turn on/off reset the
932 counter */
933/** This function is used to calculate the maximum counter value
934 since the start of monitor counter
935 @return max counter value since start. */
937 monitor_id_t monitor); /*!< in: monitor id */
938/** This function is used to calculate the minimum counter value
939 since the start of monitor counter
940 @return min counter value since start. */
942 monitor_id_t monitor); /*!< in: monitor id*/
943/** Reset a monitor, create a new base line with the current monitor
944 value. This baseline is recorded by MONITOR_VALUE_RESET(monitor) */
945void srv_mon_reset(monitor_id_t monitor); /*!< in: monitor id*/
946/** This function resets all values of a monitor counter */
947static inline void srv_mon_reset_all(
948 monitor_id_t monitor); /*!< in: monitor id*/
949/** Turn on monitor counters that are marked as default ON. */
950void srv_mon_default_on(void);
951
952#include "srv0mon.ic"
953#else /* !UNIV_HOTBACKUP */
954#define MONITOR_INC(x) ((void)0)
955#define MONITOR_DEC(x) ((void)0)
956#endif /* !UNIV_HOTBACKUP */
957
958#define MONITOR_INC_WAIT_STATS_EX(monitor_prefix, monitor_sufix, wait_stats) \
959 if ((wait_stats).wait_loops == 0) { \
960 MONITOR_INC(monitor_prefix##NO_WAITS##monitor_sufix); \
961 } else { \
962 MONITOR_INC(monitor_prefix##WAITS##monitor_sufix); \
963 MONITOR_INC_VALUE(monitor_prefix##WAIT_LOOPS##monitor_sufix, \
964 (wait_stats).wait_loops); \
965 }
966
967#define MONITOR_INC_WAIT_STATS(monitor_prefix, wait_stats) \
968 MONITOR_INC_WAIT_STATS_EX(monitor_prefix, , wait_stats);
969
970#endif
#define MONITOR_MAX_VALUE(monitor)
Definition: srv0mon.h:611
monitor_value_t innodb_counter_value[NUM_MONITOR]
The actual monitor counter array that records each monitor counter value.
Definition: srv0mon.cc:1430
void monitor_dec_value_nocheck(monitor_id_t monitor, mon_type_t value)
Definition: srv0mon.h:750
static void srv_mon_reset_all(monitor_id_t monitor)
This function resets all values of a monitor counter.
int64_t mon_type_t
Monitor counter value type.
Definition: srv0mon.h:56
monitor_type_t
Following defines are possible values for "monitor_type" field in "struct monitor_info".
Definition: srv0mon.h:91
@ MONITOR_NO_AVERAGE
Set this status if we don't want to calculate the average value for the counter.
Definition: srv0mon.h:97
@ MONITOR_HIDDEN
Do not display this monitor in the metrics table.
Definition: srv0mon.h:110
@ MONITOR_EXISTING
The monitor carries information from an existing system status variable.
Definition: srv0mon.h:95
@ MONITOR_NONE
No monitoring.
Definition: srv0mon.h:92
@ MONITOR_GROUP_MODULE
Monitor can be turned on/off only as a module, but not individually.
Definition: srv0mon.h:103
@ MONITOR_SET_OWNER
Owner of "monitor set", a set of monitor counters.
Definition: srv0mon.h:107
@ MONITOR_SET_MEMBER
Being part of a "monitor set".
Definition: srv0mon.h:109
@ MONITOR_MODULE
This is a monitor module type, not a counter.
Definition: srv0mon.h:93
@ MONITOR_DEFAULT_ON
Monitor will be turned on by default at server start up.
Definition: srv0mon.h:105
@ MONITOR_DISPLAY_CURRENT
Display current value of the counter, rather than incremental value over the period.
Definition: srv0mon.h:99
static mon_type_t srv_mon_calc_max_since_start(monitor_id_t monitor)
This function is used to calculate the maximum counter value since the start of monitor counter.
#define MONITOR_IS_ON(monitor)
Check whether the requested monitor is turned on/off.
Definition: srv0mon.h:592
void monitor_inc_value(monitor_id_t monitor, mon_type_t value)
Definition: srv0mon.h:743
void srv_mon_set_module_control(monitor_id_t module_id, mon_option_t set_option)
Turn on/off/reset monitor counters in a module.
Definition: srv0mon.cc:1468
#define MONITOR_MIN_VALUE(monitor)
Definition: srv0mon.h:613
#define MIN_RESERVED
Counter minimum value is initialized to be max value of mon_type_t (int64_t)
Definition: srv0mon.h:116
ulint monitor_set_tbl[(NUM_MONITOR+NUM_BITS_ULINT - 1)/NUM_BITS_ULINT]
This "monitor_set_tbl" is a bitmap records whether a particular monitor counter has been turned on or...
Definition: srv0mon.cc:1434
mon_option_t
Following are the "set_option" values allowed for srv_mon_process_existing_counter() and srv_mon_proc...
Definition: srv0mon.h:562
@ MONITOR_TURN_OFF
Turn off the counter.
Definition: srv0mon.h:564
@ MONITOR_GET_VALUE
Option for srv_mon_process_existing_counter() function.
Definition: srv0mon.h:567
@ MONITOR_RESET_VALUE
Reset current values.
Definition: srv0mon.h:565
@ MONITOR_RESET_ALL_VALUE
Reset all values.
Definition: srv0mon.h:566
@ MONITOR_TURN_ON
Turn on the counter.
Definition: srv0mon.h:563
void monitor_atomic_dec(monitor_id_t monitor)
Definition: srv0mon.h:721
void monitor_inc_time(monitor_id_t monitor, std::chrono::steady_clock::time_point value)
Definition: srv0mon.h:801
#define MONITOR_MIN_VALUE_START(monitor)
Definition: srv0mon.h:620
void monitor_atomic_inc(monitor_id_t monitor, mon_type_t inc_value)
Definition: srv0mon.h:711
void srv_mon_reset(monitor_id_t monitor)
Reset a monitor, create a new base line with the current monitor value.
Definition: srv0mon.cc:2059
void monitor_inc_value_cumulative(monitor_id_t monitor, monitor_id_t monitor_n_calls, monitor_id_t monitor_per_call, mon_type_t value)
Definition: srv0mon.h:829
void monitor_set_min_value(monitor_id_t monitor, mon_type_t value)
Definition: srv0mon.h:705
void monitor_inc_value_nocheck(monitor_id_t monitor, mon_type_t value, bool set_max=true)
Definition: srv0mon.h:730
void monitor_dec(monitor_id_t monitor)
Definition: srv0mon.h:768
#define MONITOR_VALUE_RESET(monitor)
Definition: srv0mon.h:615
const char * srv_mon_get_name(monitor_id_t monitor_id)
Get monitor's name by its monitor id (index into the innodb_counter_info array.
Definition: srv0mon.cc:1454
enum monitor_running_status monitor_running_t
Definition: srv0mon.h:53
void monitor_save_last(monitor_id_t monitor)
Definition: srv0mon.h:885
static mon_type_t srv_mon_calc_min_since_start(monitor_id_t monitor)
This function is used to calculate the minimum counter value since the start of monitor counter.
monitor_running_status
Possible status values for "mon_status" in "struct monitor_value".
Definition: srv0mon.h:48
@ MONITOR_STARTED
Monitor has been turned on.
Definition: srv0mon.h:49
@ MONITOR_STOPPED
Monitor has been turned off.
Definition: srv0mon.h:50
#define MONITOR_CHECK_DEFINED(value)
Definition: srv0mon.h:669
monitor_id_t
This enumeration defines internal monitor identifier used internally to identify each particular coun...
Definition: srv0mon.h:132
@ MONITOR_LRU_UNZIP_SEARCH_SCANNED_NUM_CALL
Definition: srv0mon.h:250
@ MONITOR_OVLD_BUF_POOL_PAGE_TOTAL
Definition: srv0mon.h:177
@ MONITOR_OS_PENDING_WRITES
Definition: srv0mon.h:299
@ MONITOR_OVLD_LSN_CURRENT
Definition: srv0mon.h:347
@ MONITOR_MODULE_ADAPTIVE_HASH
Definition: srv0mon.h:424
@ MONITOR_OVLD_OS_LOG_WRITTEN
Definition: srv0mon.h:300
@ MONITOR_LRU_UNZIP_SEARCH_SCANNED
Definition: srv0mon.h:249
@ NUM_MONITOR
Definition: srv0mon.h:533
@ MONITOR_OVLD_RWLOCK_X_SPIN_ROUNDS
Definition: srv0mon.h:468
@ MONITOR_LOG_FREE_SPACE
Definition: srv0mon.h:369
@ MONITOR_NUM_RECLOCK
Definition: srv0mon.h:157
@ MONITOR_PAD_DECREMENTS
Definition: srv0mon.h:412
@ MONITOR_INDEX_IBUF_LEAF_PAGE_READ
Definition: srv0mon.h:257
@ MONITOR_OVLD_LSN_CHECKPOINT
Definition: srv0mon.h:346
@ MONITOR_MODULE_DBLWR
Definition: srv0mon.h:522
@ MONITOR_OTHER_PAGE_WRITTEN
Definition: srv0mon.h:288
@ MONITOR_MODULE_PAGE_TRACK
Definition: srv0mon.h:516
@ MONITOR_MODULE_OS
Definition: srv0mon.h:294
@ MONITOR_LOG_CHECKPOINTS
Definition: srv0mon.h:368
@ MONITOR_ZBLOB2_PAGE_WRITTEN
Definition: srv0mon.h:286
@ MONITOR_LOG_FLUSHER_NO_WAITS
Definition: srv0mon.h:378
@ MONITOR_UNDO_TRUNCATE_MICROSECOND
Definition: srv0mon.h:341
@ MONITOR_RSEG_HISTORY_LEN
Definition: srv0mon.h:319
@ MONITOR_OVLD_LOCK_WAIT_TIME
Definition: srv0mon.h:162
@ MONITOR_INDEX_REORG_ATTEMPTS
Definition: srv0mon.h:419
@ MONITOR_OVLD_BUF_POOL_WAIT_FREE
Definition: srv0mon.h:174
@ MONITOR_FSP_HDR_PAGE_READ
Definition: srv0mon.h:265
@ MONITOR_RECLOCK_CREATED
Definition: srv0mon.h:155
@ MONITOR_DEADLOCK_FALSE_POSITIVES
Definition: srv0mon.h:146
@ MONITOR_FLUSH_BACKGROUND_TOTAL_PAGE
Definition: srv0mon.h:229
@ MONITOR_OVLD_PAGES_READ
Definition: srv0mon.h:186
@ MONITOR_TRX_ROLLBACK
Definition: srv0mon.h:311
@ MONITOR_OLVD_SYSTEM_ROW_READ
Definition: srv0mon.h:480
@ MONITOR_OVLD_BYTE_WRITTEN
Definition: srv0mon.h:188
@ MONITOR_LOG_WRITE_NOTIFIER_NO_WAITS
Definition: srv0mon.h:382
@ MONITOR_CPU_N
Definition: srv0mon.h:514
@ MONITOR_DBLWR_SYNC_REQUESTS
Definition: srv0mon.h:524
@ MONITOR_FLUSH_AVG_TIME
Definition: srv0mon.h:209
@ MONITOR_DEADLOCK_ROUNDS
Definition: srv0mon.h:147
@ MONITOR_LOG_ON_RECENT_CLOSED_WAIT_LOOPS
Definition: srv0mon.h:399
@ MONITOR_ICP_NO_MATCH
Definition: srv0mon.h:500
@ MONITOR_OTHER_PAGE_READ
Definition: srv0mon.h:271
@ MONITOR_LRU_BATCH_FLUSH_AVG_PASS
Definition: srv0mon.h:212
@ MONITOR_FLUSH_BATCH_SCANNED
Definition: srv0mon.h:189
@ MONITOR_TABLELOCK_REMOVED
Definition: srv0mon.h:159
@ MONITOR_LOG_FLUSH_LSN_AVG_RATE
Definition: srv0mon.h:362
@ MONITOR_PAGE_DECOMPRESS
Definition: srv0mon.h:410
@ MONITOR_OVLD_IBUF_MERGE_PURGE
Definition: srv0mon.h:442
@ MONITOR_TRX_SYSTEM_PAGE_READ
Definition: srv0mon.h:264
@ MONITOR_OVLD_IBUF_MERGES
Definition: srv0mon.h:446
@ MONITOR_PAGE_TRACK_CHECKPOINT_PARTIAL_FLUSH_REQUEST
Definition: srv0mon.h:520
@ MONITOR_FLUSH_AVG_PAGE_RATE
Definition: srv0mon.h:218
@ MONITOR_INDEX_IBUF_LEAF_PAGE_WRITTEN
Definition: srv0mon.h:274
@ MONITOR_FLUSH_N_TO_FLUSH_BY_DIRTY_PAGE
Definition: srv0mon.h:199
@ MONITOR_FLUSH_PCT_FOR_LSN
Definition: srv0mon.h:221
@ MONITOR_FLUSH_N_TO_FLUSH_REQUESTED
Definition: srv0mon.h:198
@ MONITOR_FLUSH_BATCH_SCANNED_NUM_CALL
Definition: srv0mon.h:190
@ MONITOR_INDEX_NON_LEAF_PAGE_READ
Definition: srv0mon.h:256
@ MONITOR_LRU_GET_FREE_WAITS
Definition: srv0mon.h:216
@ MONITOR_FLUSH_ADAPTIVE_TOTAL_PAGE
Definition: srv0mon.h:223
@ MONITOR_LOG_FLUSHER_WAITS
Definition: srv0mon.h:379
@ MONITOR_FLUSH_N_TO_FLUSH_BY_AGE
Definition: srv0mon.h:201
@ MONITOR_ALTER_TABLE_SORT_FILES
Definition: srv0mon.h:495
@ MONITOR_ZBLOB_PAGE_READ
Definition: srv0mon.h:268
@ MONITOR_SAMPLED_PAGES_SKIPPED
Definition: srv0mon.h:488
@ MONITOR_FLUSH_SYNC_PAGES
Definition: srv0mon.h:228
@ MONITOR_OVLD_OS_FILE_WRITE
Definition: srv0mon.h:296
@ MONITOR_PAGE_TRACK_RESETS
Definition: srv0mon.h:517
@ MONITOR_LOCKREC_WAIT
Definition: srv0mon.h:150
@ MONITOR_CPU_UTIME_ABS
Definition: srv0mon.h:510
@ MONITOR_RECLOCK_GRANT_ATTEMPTS
Definition: srv0mon.h:154
@ MONITOR_CPU_UTIME_PCT
Definition: srv0mon.h:512
@ MONITOR_OVLD_RWLOCK_S_SPIN_ROUNDS
Definition: srv0mon.h:467
@ MONITOR_UNDO_TRUNCATE
Definition: srv0mon.h:337
@ MONITOR_PURGE_STOP_COUNT
Definition: srv0mon.h:331
@ MONITOR_OVLD_BUF_POOL_READ_REQUESTS
Definition: srv0mon.h:172
@ MONITOR_OVLD_BUF_POOL_PAGES_FREE
Definition: srv0mon.h:183
@ MONITOR_INDEX_SPLIT
Definition: srv0mon.h:416
@ MONITOR_LRU_SINGLE_FLUSH_FAILURE_COUNT
Definition: srv0mon.h:244
@ MONITOR_UNDO_LOG_PAGE_WRITTEN
Definition: srv0mon.h:276
@ MONITOR_FLUSH_BATCH_PAGES
Definition: srv0mon.h:194
@ MONITOR_ALTER_TABLE_LOG_FILES
Definition: srv0mon.h:496
@ MONITOR_FLUSH_SYNC_TOTAL_PAGE
Definition: srv0mon.h:226
@ MONITOR_SCHEDULE_REFRESHES
Definition: srv0mon.h:166
@ MONITOR_TRX_ROLLBACK_SAVEPOINT
Definition: srv0mon.h:312
@ MONITOR_PAD_INCREMENTS
Definition: srv0mon.h:411
@ MONITOR_OVLD_MAX_AGE_SYNC
Definition: srv0mon.h:354
@ MONITOR_OVLD_BUF_OLDEST_LSN_APPROX
Definition: srv0mon.h:351
@ MONITOR_TRX_ACTIVE
Definition: srv0mon.h:314
@ MONITOR_ADAPTIVE_HASH_PAGE_ADDED
Definition: srv0mon.h:427
@ MONITOR_TABLELOCK_CREATED
Definition: srv0mon.h:158
@ MONITOR_DEADLOCK
Definition: srv0mon.h:145
@ MONITOR_ZBLOB2_PAGE_READ
Definition: srv0mon.h:269
@ MONITOR_MODULE_BUF_PAGE
Definition: srv0mon.h:254
@ MONITOR_INDEX_IBUF_NON_LEAF_PAGE_READ
Definition: srv0mon.h:258
@ MONITOR_OVLD_BUF_POOL_BYTES_DIRTY
Definition: srv0mon.h:182
@ MONITOR_LOG_ON_FLUSH_NO_WAITS
Definition: srv0mon.h:395
@ MONITOR_NUM_TABLELOCK
Definition: srv0mon.h:160
@ MONITOR_LOG_ON_FLUSH_WAIT_LOOPS
Definition: srv0mon.h:397
@ MONITOR_PURGE_TRUNCATE_HISTORY_MICROSECOND
Definition: srv0mon.h:334
@ MONITOR_INDEX_MERGE_ATTEMPTS
Definition: srv0mon.h:417
@ MONITOR_ICP_ATTEMPTS
Definition: srv0mon.h:499
@ MONITOR_INDEX_LEAF_PAGE_WRITTEN
Definition: srv0mon.h:272
@ MONITOR_DBLWR_FLUSH_WAIT_EVENTS
Definition: srv0mon.h:526
@ MONITOR_FLUSH_ADAPTIVE_AVG_PASS
Definition: srv0mon.h:211
@ MONITOR_MASTER_THREAD_SLEEP
Definition: srv0mon.h:451
@ MONITOR_LOG_WRITER_ON_FREE_SPACE_WAITS
Definition: srv0mon.h:375
@ MONITOR_ADAPTIVE_HASH_ROW_ADDED
Definition: srv0mon.h:429
@ MONITOR_SRV_PURGE_MICROSECOND
Definition: srv0mon.h:458
@ MONITOR_SRV_DICT_LRU_EVICT_COUNT
Definition: srv0mon.h:460
@ MONITOR_OVLD_OS_LOG_PENDING_FSYNC
Definition: srv0mon.h:302
@ MONITOR_OVLD_LOG_WAITS
Definition: srv0mon.h:355
@ MONITOR_INDEX_NON_LEAF_PAGE_WRITTEN
Definition: srv0mon.h:273
@ MONITOR_OVLD_ADAPTIVE_HASH_SEARCH_BTREE
Definition: srv0mon.h:426
@ MONITOR_LRU_BATCH_SCANNED_PER_CALL
Definition: srv0mon.h:234
@ MONITOR_INDEX_DISCARD
Definition: srv0mon.h:421
@ MONITOR_IBUF_BITMAP_PAGE_WRITTEN
Definition: srv0mon.h:279
@ MONITOR_SRV_MEM_VALIDATE_MICROSECOND
Definition: srv0mon.h:457
@ MONITOR_LOG_FLUSH_MAX_TIME
Definition: srv0mon.h:360
@ MONITOR_LOG_FLUSHER_WAIT_LOOPS
Definition: srv0mon.h:380
@ MONITOR_OVLD_RWLOCK_SX_OS_WAITS
Definition: srv0mon.h:472
@ MONITOR_OVLD_LSN_CHECKPOINT_AGE
Definition: srv0mon.h:349
@ MONITOR_TABLE_REFERENCE
Definition: srv0mon.h:141
@ MONITOR_PAGE_TRACK_FULL_BLOCK_WRITES
Definition: srv0mon.h:519
@ MONITOR_FLUSH_ADAPTIVE_PAGES
Definition: srv0mon.h:225
@ MONITOR_TRX_NL_RO_COMMIT
Definition: srv0mon.h:309
@ MONITOR_OVLD_BUF_POOL_WRITE_REQUEST
Definition: srv0mon.h:173
@ MONITOR_LOG_WRITE_TO_FILE_REQUESTS_INTERVAL
Definition: srv0mon.h:390
@ MONITOR_OVLD_BUFFER_POOL_SIZE
Definition: srv0mon.h:170
@ MONITOR_LOG_PARTIAL_BLOCK_WRITES
Definition: srv0mon.h:365
@ MONITOR_LOG_FLUSH_NOTIFIER_NO_WAITS
Definition: srv0mon.h:386
@ MONITOR_LOG_FLUSH_TOTAL_TIME
Definition: srv0mon.h:359
@ MONITOR_FLUSH_SYNC_COUNT
Definition: srv0mon.h:227
@ MONITOR_TABLELOCK_WAIT
Definition: srv0mon.h:151
@ MONITOR_FLUSH_LSN_AVG_RATE
Definition: srv0mon.h:219
@ MONITOR_MODULE_BUFFER
Definition: srv0mon.h:169
@ MONITOR_OVLD_PAGE_CREATED
Definition: srv0mon.h:184
@ MONITOR_FLUSH_BATCH_TOTAL_PAGE
Definition: srv0mon.h:192
@ MONITOR_MODULE_TRX
Definition: srv0mon.h:306
@ MONITOR_TRX_SYSTEM_PAGE_WRITTEN
Definition: srv0mon.h:281
@ MONITOR_ADAPTIVE_HASH_ROW_REMOVED
Definition: srv0mon.h:430
@ MONITOR_OVLD_RWLOCK_S_OS_WAITS
Definition: srv0mon.h:470
@ MONITOR_LRU_GET_FREE_LOOPS
Definition: srv0mon.h:215
@ MONITOR_FLUSH_BATCH_SCANNED_PER_CALL
Definition: srv0mon.h:191
@ MONITOR_RECLOCK_RELEASE_ATTEMPTS
Definition: srv0mon.h:153
@ MONITOR_FLUSH_BACKGROUND_PAGES
Definition: srv0mon.h:231
@ MONITOR_MODULE_LOCK
Definition: srv0mon.h:144
@ MONITOR_FLUSH_SYNC_WAITS
Definition: srv0mon.h:222
@ MONITOR_OVLD_ROW_LOCK_WAIT
Definition: srv0mon.h:164
@ MONITOR_INODE_PAGE_WRITTEN
Definition: srv0mon.h:277
@ MONITOR_MODULE_LATCHES
Definition: srv0mon.h:505
@ MONITOR_RECLOCK_REMOVED
Definition: srv0mon.h:156
@ MONITOR_FLUSH_NEIGHBOR_COUNT
Definition: srv0mon.h:196
@ MONITOR_MASTER_IDLE_LOOPS
Definition: srv0mon.h:454
@ MONITOR_MODULE_INDEX
Definition: srv0mon.h:415
@ MONITOR_ICP_OUT_OF_RANGE
Definition: srv0mon.h:501
@ MONITOR_OVLD_LSN_FLUSHDISK
Definition: srv0mon.h:345
@ MONITOR_LOG_ON_WRITE_WAIT_LOOPS
Definition: srv0mon.h:394
@ MONITOR_OVLD_RWLOCK_X_SPIN_WAITS
Definition: srv0mon.h:465
@ MONITOR_BACKGROUND_DROP_TABLE
Definition: srv0mon.h:492
@ MONITOR_OVLD_RWLOCK_SX_SPIN_WAITS
Definition: srv0mon.h:466
@ MONITOR_LRU_BATCH_SCANNED
Definition: srv0mon.h:232
@ MONITOR_OVLD_SERVER_ACTIVITY
Definition: srv0mon.h:452
@ MONITOR_TRX_ROLLBACK_ACTIVE
Definition: srv0mon.h:313
@ MONITOR_OVLD_LOG_WRITES
Definition: srv0mon.h:357
@ MONITOR_UNDO_TRUNCATE_DONE_LOGGING_COUNT
Definition: srv0mon.h:340
@ MONITOR_LOG_ON_WRITE_WAITS
Definition: srv0mon.h:393
@ MONITOR_UNDO_TRUNCATE_COUNT
Definition: srv0mon.h:338
@ MONITOR_OVLD_BUF_POOL_READ_AHEAD
Definition: srv0mon.h:175
@ MONITOR_SYSTEM_PAGE_READ
Definition: srv0mon.h:263
@ MONITOR_SRV_BACKGROUND_DROP_TABLE_MICROSECOND
Definition: srv0mon.h:455
@ MONITOR_OVLD_PAGES_WRITTEN
Definition: srv0mon.h:185
@ MONITOR_ICP_MATCH
Definition: srv0mon.h:502
@ MONITOR_OVLD_ADAPTIVE_HASH_SEARCH
Definition: srv0mon.h:425
@ MONITOR_FLUSH_ADAPTIVE_AVG_TIME_EST
Definition: srv0mon.h:207
@ MONITOR_IBUF_FREELIST_PAGE_READ
Definition: srv0mon.h:261
@ MONITOR_LOG_FLUSH_AVG_TIME
Definition: srv0mon.h:361
@ MONITOR_OVLD_RWLOCK_S_SPIN_WAITS
Definition: srv0mon.h:464
@ MONITOR_CPU_STIME_ABS
Definition: srv0mon.h:511
@ MONITOR_OLVD_SYSTEM_ROW_DELETED
Definition: srv0mon.h:482
@ MONITOR_RSEG_CUR_SIZE
Definition: srv0mon.h:322
@ MONITOR_OVLD_LOCK_MAX_WAIT_TIME
Definition: srv0mon.h:163
@ MONITOR_LOG_FULL_BLOCK_WRITES
Definition: srv0mon.h:364
@ MONITOR_FLUSH_ADAPTIVE_AVG_TIME_SLOT
Definition: srv0mon.h:202
@ MONITOR_LRU_SINGLE_FLUSH_SCANNED
Definition: srv0mon.h:241
@ MONITOR_OLVD_SYSTEM_ROW_INSERTED
Definition: srv0mon.h:481
@ MONITOR_BLOB_PAGE_READ
Definition: srv0mon.h:267
@ MONITOR_LOG_ON_BUFFER_SPACE_NO_WAITS
Definition: srv0mon.h:400
@ MONITOR_LOG_CONCURRENCY_MARGIN
Definition: srv0mon.h:370
@ MONITOR_TRX_COMMIT_UNDO
Definition: srv0mon.h:310
@ MONITOR_DML_PURGE_DELAY
Definition: srv0mon.h:330
@ MONITOR_LRU_BATCH_FLUSH_AVG_TIME_EST
Definition: srv0mon.h:208
@ MONITOR_RSEG_ARRAY_PAGE_WRITTEN
Definition: srv0mon.h:287
@ MONITOR_IBUF_BITMAP_PAGE_READ
Definition: srv0mon.h:262
@ MONITOR_LOG_ON_FILE_SPACE_WAITS
Definition: srv0mon.h:404
@ MONITOR_LRU_BATCH_FLUSH_TOTAL_PAGE
Definition: srv0mon.h:235
@ MONITOR_LRU_SINGLE_FLUSH_SCANNED_PER_CALL
Definition: srv0mon.h:243
@ MONITOR_LRU_SEARCH_SCANNED
Definition: srv0mon.h:246
@ MONITOR_OVLD_RWLOCK_SX_SPIN_ROUNDS
Definition: srv0mon.h:469
@ MONITOR_OVLD_SRV_PAGE_SIZE
Definition: srv0mon.h:463
@ MONITOR_OVLD_OS_FILE_READ
Definition: srv0mon.h:295
@ MONITOR_TRX_ON_LOG_WAITS
Definition: srv0mon.h:317
@ MONITOR_UNDO_TRUNCATE_START_LOGGING_COUNT
Definition: srv0mon.h:339
@ MONITOR_LRU_BATCH_FLUSH_COUNT
Definition: srv0mon.h:236
@ MONITOR_N_DEL_ROW_PURGE
Definition: srv0mon.h:326
@ MONITOR_OVLD_LOG_WRITE_REQUEST
Definition: srv0mon.h:356
@ MONITOR_OVLD_OS_FSYNC
Definition: srv0mon.h:297
@ MONITOR_FLUSH_ADAPTIVE_AVG_TIME_THREAD
Definition: srv0mon.h:205
@ MONITOR_MODULE_REDO_LOG
Definition: srv0mon.h:344
@ MONITOR_OS_PENDING_READS
Definition: srv0mon.h:298
@ MONITOR_LOG_ON_FILE_SPACE_WAIT_LOOPS
Definition: srv0mon.h:405
@ MONITOR_OVLD_BUF_POOL_PAGES_DATA
Definition: srv0mon.h:179
@ MONITOR_OVLD_RWLOCK_X_OS_WAITS
Definition: srv0mon.h:471
@ MONITOR_FLUSH_PCT_FOR_DIRTY
Definition: srv0mon.h:220
@ MONITOR_OVLD_IBUF_MERGE_DISCARD_INSERT
Definition: srv0mon.h:443
@ MONITOR_ON_LOG_NO_WAITS_PAGE_WRITTEN
Definition: srv0mon.h:289
@ MONITOR_MODULE_IBUF_SYSTEM
Definition: srv0mon.h:439
@ MONITOR_CPU_STIME_PCT
Definition: srv0mon.h:513
@ MONITOR_TIMEOUT
Definition: srv0mon.h:149
@ MONITOR_OVLD_IBUF_MERGE_INSERT
Definition: srv0mon.h:440
@ MONITOR_MODULE_CPU
Definition: srv0mon.h:509
@ MONITOR_INDEX_IBUF_NON_LEAF_PAGE_WRITTEN
Definition: srv0mon.h:275
@ MONITOR_PURGE_TRUNCATE_HISTORY_COUNT
Definition: srv0mon.h:333
@ MONITOR_OVLD_LSN_BUF_DIRTY_PAGES_ADDED
Definition: srv0mon.h:350
@ MONITOR_OVLD_BUF_POOL_READS
Definition: srv0mon.h:171
@ MONITOR_OLVD_ROW_DELETED
Definition: srv0mon.h:478
@ MONITOR_ADAPTIVE_HASH_ROW_REMOVE_NOT_FOUND
Definition: srv0mon.h:431
@ MONITOR_LATCHES
Definition: srv0mon.h:506
@ MONITOR_NUM_UNDO_SLOT_CACHED
Definition: srv0mon.h:321
@ MONITOR_OVLD_MAX_AGE_ASYNC
Definition: srv0mon.h:353
@ MONITOR_OVLD_SRV_DBLWR_WRITES
Definition: srv0mon.h:461
@ MONITOR_DEFAULT_START
Definition: srv0mon.h:135
@ MONITOR_LOG_ON_BUFFER_SPACE_WAIT_LOOPS
Definition: srv0mon.h:402
@ MONITOR_NUM_RECLOCK_REQ
Definition: srv0mon.h:152
@ MONITOR_FLUSH_ADAPTIVE_COUNT
Definition: srv0mon.h:224
@ MONITOR_TRX_RO_COMMIT
Definition: srv0mon.h:308
@ MONITOR_MODULE_DDL_STATS
Definition: srv0mon.h:491
@ MONITOR_MASTER_ACTIVE_LOOPS
Definition: srv0mon.h:453
@ MONITOR_LRU_BATCH_SCANNED_NUM_CALL
Definition: srv0mon.h:233
@ MONITOR_LOG_NEXT_FILE
Definition: srv0mon.h:367
@ MONITOR_OLVD_ROW_UPDTATED
Definition: srv0mon.h:479
@ MONITOR_LOG_WRITER_NO_WAITS
Definition: srv0mon.h:372
@ MONITOR_BLOB_PAGE_WRITTEN
Definition: srv0mon.h:284
@ MONITOR_FLUSH_NEIGHBOR_PAGES
Definition: srv0mon.h:197
@ MONITOR_OVLD_LSN_ARCHIVED
Definition: srv0mon.h:348
@ MONITOR_MODULE_METADATA
Definition: srv0mon.h:138
@ MONITOR_OVLD_LOCK_AVG_WAIT_TIME
Definition: srv0mon.h:165
@ MONITOR_OVLD_OS_LOG_FSYNC
Definition: srv0mon.h:301
@ MONITOR_MODULE_SERVER
Definition: srv0mon.h:450
@ MONITOR_ADAPTIVE_HASH_PAGE_REMOVED
Definition: srv0mon.h:428
@ MONITOR_MODULE_PAGE
Definition: srv0mon.h:408
@ MONITOR_OVLD_BUF_OLDEST_LSN_LWM
Definition: srv0mon.h:352
@ MONITOR_RSEG_ARRAY_PAGE_READ
Definition: srv0mon.h:270
@ MONITOR_TRX_ALLOCATIONS
Definition: srv0mon.h:315
@ MONITOR_OVLD_OS_LOG_PENDING_WRITES
Definition: srv0mon.h:303
@ MONITOR_LOG_FLUSH_NOTIFIER_WAITS
Definition: srv0mon.h:387
@ MONITOR_OVLD_SRV_DBLWR_PAGES_WRITTEN
Definition: srv0mon.h:462
@ MONITOR_LRU_BATCH_FLUSH_AVG_TIME_THREAD
Definition: srv0mon.h:206
@ MONITOR_LRU_UNZIP_SEARCH_SCANNED_PER_CALL
Definition: srv0mon.h:251
@ MONITOR_LRU_BATCH_EVICT_PAGES
Definition: srv0mon.h:240
@ MONITOR_LOG_WRITER_ON_ARCHIVER_WAITS
Definition: srv0mon.h:376
@ MONITOR_OLVD_SYSTEM_ROW_UPDATED
Definition: srv0mon.h:483
@ MONITOR_XDES_PAGE_WRITTEN
Definition: srv0mon.h:283
@ MONITOR_MODULE_SAMPLING_STATS
Definition: srv0mon.h:486
@ MONITOR_FLUSH_AVG_PASS
Definition: srv0mon.h:213
@ MONITOR_PAGE_TRACK_PARTIAL_BLOCK_WRITES
Definition: srv0mon.h:518
@ MONITOR_LRU_SEARCH_SCANNED_NUM_CALL
Definition: srv0mon.h:247
@ MONITOR_NUM_UNDO_SLOT_USED
Definition: srv0mon.h:320
@ MONITOR_LOG_ON_BUFFER_SPACE_WAITS
Definition: srv0mon.h:401
@ MONITOR_OVLD_BUF_POOL_READ_AHEAD_EVICTED
Definition: srv0mon.h:176
@ MONITOR_MODULE_ICP
Definition: srv0mon.h:498
@ MONITOR_ON_LOG_WAITS_PAGE_WRITTEN
Definition: srv0mon.h:290
@ MONITOR_INDEX_REORG_SUCCESSFUL
Definition: srv0mon.h:420
@ MONITOR_LOG_WRITE_NOTIFIER_WAIT_LOOPS
Definition: srv0mon.h:384
@ MONITOR_OVLD_N_FILE_OPENED
Definition: srv0mon.h:436
@ MONITOR_PURGE_INVOKED
Definition: srv0mon.h:328
@ MONITOR_FLUSH_NEIGHBOR_TOTAL_PAGE
Definition: srv0mon.h:195
@ MONITOR_OVLD_IBUF_MERGE_DISCARD_PURGE
Definition: srv0mon.h:445
@ MONITOR_OVLD_ROW_LOCK_CURRENT_WAIT
Definition: srv0mon.h:161
@ MONITOR_LRU_GET_FREE_SEARCH
Definition: srv0mon.h:245
@ MONITOR_ON_LOG_WAIT_LOOPS_PAGE_WRITTEN
Definition: srv0mon.h:291
@ MONITOR_ADAPTIVE_HASH_ROW_UPDATED
Definition: srv0mon.h:432
@ MONITOR_LOG_ON_FILE_SPACE_NO_WAITS
Definition: srv0mon.h:403
@ MONITOR_TRX_RW_COMMIT
Definition: srv0mon.h:307
@ MONITOR_INODE_PAGE_READ
Definition: srv0mon.h:260
@ MONITOR_SRV_IBUF_MERGE_MICROSECOND
Definition: srv0mon.h:456
@ MONITOR_LRU_BATCH_FLUSH_AVG_TIME_SLOT
Definition: srv0mon.h:203
@ MONITOR_DBLWR_ASYNC_REQUESTS
Definition: srv0mon.h:523
@ MONITOR_LOG_ON_WRITE_NO_WAITS
Definition: srv0mon.h:392
@ MONITOR_LOG_ON_RECENT_WRITTEN_WAIT_LOOPS
Definition: srv0mon.h:398
@ MONITOR_PURGE_N_PAGE_HANDLED
Definition: srv0mon.h:329
@ MONITOR_TABLE_CLOSE
Definition: srv0mon.h:140
@ MONITOR_LOCK_THREADS_WAITING
Definition: srv0mon.h:148
@ MONITOR_FLUSH_BACKGROUND_COUNT
Definition: srv0mon.h:230
@ MONITOR_INDEX_MERGE_SUCCESSFUL
Definition: srv0mon.h:418
@ MONITOR_ZBLOB_PAGE_WRITTEN
Definition: srv0mon.h:285
@ MONITOR_LRU_BATCH_FLUSH_PAGES
Definition: srv0mon.h:237
@ MONITOR_XDES_PAGE_READ
Definition: srv0mon.h:266
@ MONITOR_OVLD_IBUF_MERGE_DELETE
Definition: srv0mon.h:441
@ MONITOR_OVLD_BUF_POOL_BYTES_DATA
Definition: srv0mon.h:180
@ MONITOR_LRU_SINGLE_FLUSH_SCANNED_NUM_CALL
Definition: srv0mon.h:242
@ MONITOR_TABLE_OPEN
Definition: srv0mon.h:139
@ MONITOR_MODULE_DML_STATS
Definition: srv0mon.h:475
@ MONITOR_DBLWR_FLUSH_REQUESTS
Definition: srv0mon.h:525
@ MONITOR_OLVD_ROW_READ
Definition: srv0mon.h:476
@ MONITOR_PENDING_ALTER_TABLE
Definition: srv0mon.h:494
@ MONITOR_LRU_SEARCH_SCANNED_PER_CALL
Definition: srv0mon.h:248
@ MONITOR_MODULE_PURGE
Definition: srv0mon.h:325
@ MONITOR_SRV_DICT_LRU_MICROSECOND
Definition: srv0mon.h:459
@ MONITOR_ONLINE_CREATE_INDEX
Definition: srv0mon.h:493
@ MONITOR_OVLD_IBUF_SIZE
Definition: srv0mon.h:447
@ MONITOR_MODULE_FIL_SYSTEM
Definition: srv0mon.h:435
@ MONITOR_INDEX_LEAF_PAGE_READ
Definition: srv0mon.h:255
@ MONITOR_PAGE_COMPRESS
Definition: srv0mon.h:409
@ MONITOR_OVLD_IBUF_MERGE_DISCARD_DELETE
Definition: srv0mon.h:444
@ MONITOR_PURGE_RESUME_COUNT
Definition: srv0mon.h:332
@ MONITOR_LRU_BATCH_EVICT_TOTAL_PAGE
Definition: srv0mon.h:238
@ MONITOR_TRX_ON_LOG_WAIT_LOOPS
Definition: srv0mon.h:318
@ MONITOR_LRU_BATCH_EVICT_COUNT
Definition: srv0mon.h:239
@ MONITOR_FSP_HDR_PAGE_WRITTEN
Definition: srv0mon.h:282
@ MONITOR_OVLD_BUF_POOL_PAGES_DIRTY
Definition: srv0mon.h:181
@ MONITOR_IBUF_FREELIST_PAGE_WRITTEN
Definition: srv0mon.h:278
@ MONITOR_ALL_COUNTER
Definition: srv0mon.h:530
@ MONITOR_SYSTEM_PAGE_WRITTEN
Definition: srv0mon.h:280
@ MONITOR_OLVD_ROW_INSERTED
Definition: srv0mon.h:477
@ MONITOR_OVLD_BUF_POOL_PAGE_MISC
Definition: srv0mon.h:178
@ MONITOR_LOG_PADDED
Definition: srv0mon.h:366
@ MONITOR_N_UPD_EXIST_EXTERN
Definition: srv0mon.h:327
@ MONITOR_SAMPLED_PAGES_READ
Definition: srv0mon.h:487
@ MONITOR_UNDO_LOG_PAGE_READ
Definition: srv0mon.h:259
@ MONITOR_LOG_ON_FLUSH_WAITS
Definition: srv0mon.h:396
@ MONITOR_FLUSH_BATCH_COUNT
Definition: srv0mon.h:193
@ MONITOR_LOG_WRITER_WAITS
Definition: srv0mon.h:373
@ MONITOR_LOG_WRITE_NOTIFIER_WAITS
Definition: srv0mon.h:383
@ MONITOR_OVLD_BYTE_READ
Definition: srv0mon.h:187
@ MONITOR_LOG_FLUSH_NOTIFIER_WAIT_LOOPS
Definition: srv0mon.h:388
@ MONITOR_LOG_WRITER_WAIT_LOOPS
Definition: srv0mon.h:374
@ MONITOR_TRX_ON_LOG_NO_WAITS
Definition: srv0mon.h:316
#define MONITOR_VALUE(monitor)
Definition: srv0mon.h:609
#define MAX_RESERVED
Definition: srv0mon.h:117
#define MONITOR_MAX_VALUE_START(monitor)
Definition: srv0mon.h:617
void monitor_set(monitor_id_t monitor, mon_type_t value, bool set_max, bool set_min)
Sets a value to the monitor counter.
Definition: srv0mon.h:782
#define MONITOR_INIT_ZERO_VALUE
Definition: srv0mon.h:646
#define MONITOR_FIELD(monitor, field)
Following are macro defines for basic monitor counter manipulations.
Definition: srv0mon.h:607
#define MONITOR_LAST_VALUE(monitor)
Definition: srv0mon.h:623
void srv_mon_default_on(void)
Turn on monitor counters that are marked as default ON.
Definition: srv0mon.cc:2101
#define MONITOR_START_VALUE(monitor)
Definition: srv0mon.h:625
void monitor_set_max_value(monitor_id_t monitor, mon_type_t value)
Definition: srv0mon.h:699
void monitor_reset_all(monitor_id_t monitor)
Definition: srv0mon.h:855
void monitor_dec_value(monitor_id_t monitor, mon_type_t value)
Definition: srv0mon.h:760
monitor_info_t * srv_mon_get_info(monitor_id_t monitor_id)
Get monitor's monitor_info_t by its monitor id (index into the innodb_counter_info array.
Definition: srv0mon.cc:1440
void srv_mon_process_existing_counter(monitor_id_t monitor_id, mon_option_t set_option)
This function consolidates some existing server counters used by "system status variables".
Definition: srv0mon.cc:1605
#define NUM_BITS_ULINT
Number of bit in a ulint datatype.
Definition: srv0mon.h:574
Server monitoring system.
struct monitor_info describes the basic/static information about each monitor counter.
Definition: srv0mon.h:545
const char * monitor_module
Sub Module the monitor belongs to.
Definition: srv0mon.h:547
const char * monitor_name
Monitor name.
Definition: srv0mon.h:546
monitor_id_t monitor_id
Monitor ID as defined in enum monitor_id_t.
Definition: srv0mon.h:555
const char * monitor_desc
Brief desc of monitor counter.
Definition: srv0mon.h:549
monitor_id_t monitor_related_id
Monitor ID of counter that related to this monitor.
Definition: srv0mon.h:551
monitor_type_t monitor_type
Type of Monitor Info.
Definition: srv0mon.h:550
Two monitor structures are defined in this file.
Definition: srv0mon.h:71
std::chrono::system_clock::time_point mon_stop_time
Stop time of monitoring.
Definition: srv0mon.h:75
mon_type_t mon_max_value
Current Max value.
Definition: srv0mon.h:79
std::chrono::system_clock::time_point mon_reset_time
Time counter was reset.
Definition: srv0mon.h:77
mon_type_t mon_value_reset
value at last reset
Definition: srv0mon.h:81
mon_type_t mon_min_value_start
Min value since start.
Definition: srv0mon.h:83
mon_type_t mon_start_value
Value at the start time.
Definition: srv0mon.h:84
std::atomic< mon_type_t > mon_value
Current counter Value.
Definition: srv0mon.h:78
std::chrono::system_clock::time_point mon_start_time
Start time of monitoring
Definition: srv0mon.h:73
mon_type_t mon_last_value
Last set of values.
Definition: srv0mon.h:85
mon_type_t mon_max_value_start
Max value since start.
Definition: srv0mon.h:82
mon_type_t mon_min_value
Current Min value.
Definition: srv0mon.h:80
monitor_running_t mon_status
Definition: srv0mon.h:86
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:406
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:69