MySQL 9.1.0
Source Code Documentation
|
Database monitor counter interfaces. More...
#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"
Macros | |
#define | MONITOR_BUF_PAGE(name, description, code, op, 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) |
#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) |
#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) |
Functions | |
monitor_info_t * | srv_mon_get_info (monitor_id_t monitor_id) |
Get a monitor's "monitor_info" by its monitor id (index into the innodb_counter_info array. More... | |
const char * | srv_mon_get_name (monitor_id_t monitor_id) |
Get monitor's name by its monitor id (indexing into the innodb_counter_info array. More... | |
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. More... | |
static ulint | srv_mon_get_rseg_size (void) |
Get transaction system's rollback segment size in pages. More... | |
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". More... | |
void | srv_mon_reset (monitor_id_t monitor) |
Reset a monitor, create a new base line with the current monitor value. More... | |
void | srv_mon_default_on (void) |
Turn on monitor counters that are marked as default ON. More... | |
Variables | |
static monitor_info_t | innodb_counter_info [] |
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. More... | |
monitor_value_t | innodb_counter_value [NUM_MONITOR] |
The actual monitor counter array that records each monitor counter value. More... | |
std::bitset< NUM_MONITOR > | monitor_set_tbl |
This "monitor_set_tbl" is a bitmap records whether a particular monitor counter has been turned on or off. More... | |
Database monitor counter interfaces.
Created 12/9/2009 Jimmy Yang
#define MONITOR_BUF_PAGE | ( | name, | |
description, | |||
code, | |||
op, | |||
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_BUF_PAGE_WRITTEN_WAIT_STATS | ( | name, | |
description, | |||
code | |||
) |
#define MONITOR_BUF_PAGE_WRITTEN_WAIT_STATS_WRAP | ( | name, | |
module, | |||
description, | |||
a, | |||
b, | |||
code | |||
) | MONITOR_BUF_PAGE_WRITTEN(name, description, code) |
#define MONITOR_WAIT_STATS | ( | name, | |
module, | |||
description, | |||
code | |||
) |
#define MONITOR_WAIT_STATS_EX | ( | name, | |
module, | |||
description, | |||
code, | |||
wrap | |||
) |
#define MONITOR_WAIT_STATS_SIMPLE_WRAP | ( | a1, | |
a2, | |||
a3, | |||
a4, | |||
a5, | |||
a6 | |||
) | { a1, a2, a3, a4, a5, a6 } |
void srv_mon_default_on | ( | void | ) |
Turn on monitor counters that are marked as default ON.
monitor_info_t * srv_mon_get_info | ( | monitor_id_t | monitor_id | ) |
Get a monitor's "monitor_info" by its monitor id (index into the innodb_counter_info array.
Get monitor's monitor_info_t by its monitor id (index into the innodb_counter_info array.
monitor_id | id indexing into the innodb_counter_info array |
const char * srv_mon_get_name | ( | monitor_id_t | monitor_id | ) |
Get monitor's name by its monitor id (indexing into the innodb_counter_info array.
Get monitor's name by its monitor id (index into the innodb_counter_info array.
monitor_id | id index into the innodb_counter_info array |
|
static |
Get transaction system's rollback segment size in pages.
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".
These existing system variables do not have mechanism to start/stop and reset the counters, so we simulate these controls by remembering the corresponding counter values when the corresponding monitors are turned on/off/reset, and do appropriate mathematics to deduct the actual value. Please also refer to srv_export_innodb_status() for related global counters used by the existing status variables.
monitor_id | in: the monitor's ID as in monitor_counter_id |
set_option | in: Turn on/off reset the counter |
void srv_mon_reset | ( | monitor_id_t | monitor | ) |
Reset a monitor, create a new base line with the current monitor value.
This baseline is recorded by MONITOR_VALUE_RESET(monitor)
monitor | in: monitor id |
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.
Turn on/off/reset monitor counters in a module.
If module_id is MONITOR_ALL_COUNTER then turn on all monitor counters. turned on because it has already been turned on.
module_id | in: Module ID as in monitor_counter_id. If it is set to MONITOR_ALL_COUNTER, this means we shall turn on all the counters |
set_option | in: Turn on/off reset the counter |
|
static |
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.
monitor_value_t innodb_counter_value[NUM_MONITOR] |
The actual monitor counter array that records each monitor counter value.
std::bitset<NUM_MONITOR> monitor_set_tbl |
This "monitor_set_tbl" is a bitmap records whether a particular monitor counter has been turned on or off.