MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
srv0mon.cc File Reference
#include "os0file.h"
#include "mach0data.h"
#include "srv0mon.h"
#include "srv0srv.h"
#include "buf0buf.h"
#include "trx0sys.h"
#include "trx0rseg.h"
#include "lock0lock.h"
#include "ibuf0ibuf.h"
Include dependency graph for srv0mon.cc:

Go to the source code of this file.

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)

Functions

UNIV_INTERN void srv_mon_create (void)
UNIV_INTERN void srv_mon_free (void)
UNIV_INTERN monitor_info_tsrv_mon_get_info (monitor_id_t monitor_id)
UNIV_INTERN const char * srv_mon_get_name (monitor_id_t monitor_id)
UNIV_INTERN void srv_mon_set_module_control (monitor_id_t module_id, mon_option_t set_option)
UNIV_INTERN void srv_mon_process_existing_counter (monitor_id_t monitor_id, mon_option_t set_option)
UNIV_INTERN void srv_mon_reset (monitor_id_t monitor)
UNIV_INTERN void srv_mon_default_on (void)

Variables

UNIV_INTERN monitor_value_t innodb_counter_value [NUM_MONITOR]
UNIV_INTERN ulint monitor_set_tbl [(NUM_MONITOR+NUM_BITS_ULINT-1)/NUM_BITS_ULINT]
ib_mutex_t monitor_mutex
UNIV_INTERN mysql_pfs_key_t monitor_mutex_key

Detailed Description

Database monitor counter interfaces

Created 12/9/2009 Jimmy Yang

Definition in file srv0mon.cc.

Macro Definition Documentation

#define MONITOR_BUF_PAGE (   name,
  description,
  code,
  op,
  op_code 
)
Value:
{"buffer_page_"op"_"name, "buffer_page_io", \
"Number of "description" Pages "op, \
MONITOR_GROUP_MODULE, MONITOR_DEFAULT_START, \
MONITOR_##code##_##op_code}

Definition at line 43 of file srv0mon.cc.

Function Documentation

UNIV_INTERN void srv_mon_create ( void  )

Initialize the monitor subsystem.

Definition at line 1221 of file srv0mon.cc.

Here is the caller graph for this function:

UNIV_INTERN void srv_mon_default_on ( void  )

Turn on monitor counters that are marked as default ON.

Definition at line 1895 of file srv0mon.cc.

UNIV_INTERN void srv_mon_free ( void  )

Close the monitor subsystem.

Definition at line 1230 of file srv0mon.cc.

UNIV_INTERN 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.

Returns
Point to corresponding monitor_info_t, or NULL if no such monitor
Parameters
monitor_idid indexing into the innodb_counter_info array

Definition at line 1244 of file srv0mon.cc.

Here is the caller graph for this function:

UNIV_INTERN 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.

Returns
corresponding monitor name, or NULL if no such monitor
Parameters
monitor_idid index into the innodb_counter_info array

Definition at line 1263 of file srv0mon.cc.

Here is the caller graph for this function:

UNIV_INTERN 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.

Parameters
monitor_idin: the monitor's ID as in monitor_counter_id
set_optionin: Turn on/off reset the counter

Definition at line 1418 of file srv0mon.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN 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)

Parameters
monitorin: monitor id

Definition at line 1847 of file srv0mon.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

UNIV_INTERN 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. If module_id is MONITOR_ALL_COUNTER then turn on all monitor counters. turned on because it has already been turned on.

Parameters
module_idin: 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_optionin: Turn on/off reset the counter

Definition at line 1281 of file srv0mon.cc.

Here is the call graph for this function:

Variable Documentation

UNIV_INTERN monitor_value_t innodb_counter_value[NUM_MONITOR]
The actual monitor counter array that records each monintor counter

value

Definition at line 1202 of file srv0mon.cc.

ib_mutex_t monitor_mutex
Mutex protecting atomic operations on platforms that lack

built-in operations for atomic memory access

Definition at line 1212 of file srv0mon.cc.

UNIV_INTERN mysql_pfs_key_t monitor_mutex_key

Key to register monitor_mutex with performance schema

Definition at line 1215 of file srv0mon.cc.

UNIV_INTERN 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 off

Definition at line 1207 of file srv0mon.cc.