工具名称由由 '/'' 字符分隔的一系列元素组成。示例名称:An instrument name consists of a sequence of elements separated by
'/' characters. Example names:
wait/io/file/myisam/log wait/io/file/mysys/charset wait/lock/table/sql/handler wait/synch/cond/mysys/COND_alarm wait/synch/cond/sql/BINLOG::update_cond wait/synch/mutex/mysys/BITMAP_mutex wait/synch/mutex/sql/LOCK_delete wait/synch/rwlock/sql/Query_cache_query::lock stage/sql/closing tables stage/sql/Sorting result statement/com/Execute statement/com/Query statement/sql/create_table statement/sql/lock_tables errors
仪器名称空间具有树状结构。仪器名称的各个元素从左到右提供了从一般到具体的渐进。名称中元素的数量取决于仪器的类型。The instrument name space has a tree-like structure. The elements of an instrument name from left to right provide a progression from more general to more specific. The number of elements a name has depends on the type of instrument.
The interpretation of a given element in a name depends on the
elements to the left of it. For example, myisam
appears in both of the following names, but
myisam in the first name is related to file
I/O, whereas in the second it is related to a synchronization
instrument:
wait/io/file/myisam/log wait/synch/cond/myisam/MI_SORT_INFO::cond
仪器名称由前缀和后缀组成,前缀的结构由 Performance Schema 实现定义,后缀由实现仪器代码的开发者定义。仪器前缀的顶层元素表示仪器的类型。该元素还决定了 performance_timers 表中的哪一个事件计时器适用于该仪器。对于仪器名称的前缀部分,顶层表示仪器类型。Instrument names consist of a prefix with a structure defined by
the Performance Schema implementation and a suffix defined by the
developer implementing the instrument code. The top-level element
of an instrument prefix indicates the type of instrument. This
element also determines which event timer in the
performance_timers table applies to
the instrument. For the prefix part of instrument names, the top
level indicates the type of instrument.
仪器名称的后缀部分来自仪器本身的代码。后缀可能包括以下级别:The suffix part of instrument names comes from the code for the instruments themselves. Suffixes may include levels such as these:
主要元素的名称(一个服务器模块,如
myisam、innodb、mysys或sql)或插件名称。A name for the major element (a server module such asmyisam,innodb,mysys, orsql) or a plugin name.代码中变量的名称,形式为
XXX(全局变量)或(类CCC::MMMCCC的成员MMM)。示例:COND_thread_cache、THR_LOCK_myisam、BINLOG::LOCK_index。The name of a variable in the code, in the formXXX(a global variable) or(a memberCCC::MMMMMMin classCCC). Examples:COND_thread_cache,THR_LOCK_myisam,BINLOG::LOCK_index.
idle:一个被监控的空闲事件。该仪器没有进一步的元素。idle: An instrumented idle event. This instrument has no further elements.error:一个被监控的错误事件。该仪器没有进一步的元素。error: An instrumented error event. This instrument has no further elements.memory:一个被监控的内存事件。memory: An instrumented memory event.stage:一个被监控的阶段事件。stage: An instrumented stage event.statement:一个被监控的语句事件。statement: An instrumented statement event.transaction:一个带有监测的事务事件。该监测没有其他元素。transaction: An instrumented transaction event. This instrument has no further elements.wait:一个带有监测的等待事件。wait: An instrumented wait event.
idle 监测用于空闲事件,性能模式生成这些事件,如在 第 29.12.3.5 节,“socket_instances 表” 中 socket_instances.STATE 列的描述中所讨论。The idle instrument is used for idle events,
which The Performance Schema generates as discussed in the
description of the socket_instances.STATE
column in
Section 29.12.3.5, “The socket_instances Table”.
该error instrument indicates whether to
collect information for server errors and warnings. This
instrument is enabled by default. The TIMED
column for the error row in the
setup_instruments table is
inapplicable because timing information is not collected.The error instrument indicates whether to
collect information for server errors and warnings. This
instrument is enabled by default. The TIMED
column for the error row in the
setup_instruments table is
inapplicable because timing information is not collected.
内存监控默认已启用。内存监控可以在启动时启用或禁用,也可以在运行时通过更新setup_instruments表中相关监控项的ENABLED列来动态启用或禁用。内存监控器的名称形式为memory/,其中code_area/instrument_namecode_area是类似sql或myisam的值,而instrument_name是监控器的详细信息。Memory instrumentation is enabled by default. Memory
instrumentation can be enabled or disabled at startup, or
dynamically at runtime by updating the
ENABLED column of the relevant instruments in
the setup_instruments table. Memory
instruments have names of the form
memory/
where code_area/instrument_namecode_area is a value such as
sql or myisam, and
instrument_name is the instrument
detail.
以 memory/performance_schema/ 为前缀命名的仪器显示了性能模式中为内部缓冲区分配了多少内存。memory/performance_schema/ 仪器是内置的,总是启用的,且在启动或运行时无法禁用。内置内存仪器仅显示在 memory_summary_global_by_event_name 表中。更多信息,请参见 第 29.17 节,“性能模式内存分配模型”。Instruments named with the prefix
memory/performance_schema/ expose how much
memory is allocated for internal buffers in the Performance
Schema. The memory/performance_schema/
instruments are built in, always enabled, and cannot be disabled
at startup or runtime. Built-in memory instruments are displayed
only in the
memory_summary_global_by_event_name
table. For more information, see
Section 29.17, “The Performance Schema Memory-Allocation Model”.
舞台工具的名称形式为 stage/,其中 code_area/stage_namecode_area 的值例如 sql 或 myisam,而 stage_name 表示语句处理的阶段,例如 Sorting result 或 Sending data。这些阶段对应于 SHOW
PROCESSLIST 显示的线程状态,或者在 Information Schema PROCESSLIST 表中可见的线程状态。Stage instruments have names of the form
stage/,
where code_area/stage_namecode_area is a value such as
sql or myisam, and
stage_name indicates the stage of
statement processing, such as Sorting result
or Sending data. Stages correspond to the
thread states displayed by SHOW
PROCESSLIST or that are visible in the Information
Schema PROCESSLIST table.
statement/abstract/*:一种用于语句操作的抽象工具。在语句分类的早期阶段使用抽象工具,当确切的语句类型未知时使用,随后在类型已知时会更改为更具体的语句工具。有关此过程的描述,请参见 第 29.12.6 节,“性能模式语句事件表”。statement/abstract/*: An abstract instrument for statement operations. Abstract instruments are used during the early stages of statement classification before the exact statement type is known, then changed to a more specific statement instrument when the type is known. For a description of this process, see Section 29.12.6, “Performance Schema Statement Event Tables”.statement/com:一个已加工具的命令操作。这些操作的名称对应于COM_操作(参见xxxmysql_com.h头文件和sql/sql_parse.cc)。例如,statement/com/Connect和statement/com/Init DB加工具对应于COM_CONNECT和COM_INIT_DB命令。statement/com: An instrumented command operation. These have names corresponding toCOM_operations (see thexxxmysql_com.hheader file andsql/sql_parse.cc. For example, thestatement/com/Connectandstatement/com/Init DBinstruments correspond to theCOM_CONNECTandCOM_INIT_DBcommands.statement/scheduler/event:一个用于追踪事件调度器执行的所有事件的单一加工具。这个加工具在调度事件开始执行时发挥作用。statement/scheduler/event: A single instrument to track all events executed by the Event Scheduler. This instrument comes into play when a scheduled event begins executing.statement/sp:由存储程序执行的带有监视功能的内部指令。例如,statement/sp/cfetch和statement/sp/freturn工具用于游标获取和函数返回指令。statement/sp: An instrumented internal instruction executed by a stored program. For example, thestatement/sp/cfetchandstatement/sp/freturninstruments are used cursor fetch and function return instructions.statement/sql:带有监视功能的 SQL 语句操作。例如,statement/sql/create_db和statement/sql/select工具用于CREATE DATABASE和SELECT语句。statement/sql: An instrumented SQL statement operation. For example, thestatement/sql/create_dbandstatement/sql/selectinstruments are used forCREATE DATABASEandSELECTstatements.
在 setup_threads 表中显示已插装的线程,该表展示了线程类名称和属性。Instrumented threads are displayed in the
setup_threads table, which exposes
thread class names and attributes.
线程插装以 thread 开头(例如,thread/sql/parser_service 或 thread/performance_schema/setup)。Thread instruments begin with thread (for
example, thread/sql/parser_service or
thread/performance_schema/setup).
ndbcluster 插件线程的线程插装名称以 thread/ndbcluster/ 开头;有关这些的更多信息,请参见 ndbcluster 插件线程。The names of thread instruments for
ndbcluster plugin threads begin with
thread/ndbcluster/; for more information
about these, see ndbcluster Plugin Threads.
wait/io一个已插装的 I/O 操作。An instrumented I/O operation.
wait/io/file一个已插装的文件 I/O 操作。对于文件来说,等待时间是指等待文件操作完成的时间(例如,调用
fwrite())。由于缓存的原因,磁盘上的实际文件 I/O 可能不会在此调用中发生。An instrumented file I/O operation. For files, the wait is the time waiting for the file operation to complete (for example, a call tofwrite()). Due to caching, the physical file I/O on the disk might not happen within this call.wait/io/socket一个已插装的套接字操作。套接字插装器的名称格式为
wait/io/socket/sql/。服务器为其支持的每种网络协议都有一个监听套接字。与 TCP/IP 或 Unix 套接字文件连接的监听套接字相关联的插装器,其socket_typesocket_type值分别为server_tcpip_socket或server_unix_socket。当监听套接字检测到连接时,服务器将该连接转移到由单独线程管理的新套接字。新连接线程的插装器的socket_type值为client_connection。An instrumented socket operation. Socket instruments have names of the formwait/io/socket/sql/. The server has a listening socket for each network protocol that it supports. The instruments associated with listening sockets for TCP/IP or Unix socket file connections have asocket_typesocket_typevalue ofserver_tcpip_socketorserver_unix_socket, respectively. When a listening socket detects a connection, the server transfers the connection to a new socket managed by a separate thread. The instrument for the new connection thread has asocket_typevalue ofclient_connection.wait/io/table一个带有监测的表 I/O 操作。这些操作包括对持久性基础表或临时表的行级访问。影响行的操作有提取、插入、更新和删除。对于视图,等待与视图引用的基础表相关联。An instrumented table I/O operation. These include row-level accesses to persistent base tables or temporary tables. Operations that affect rows are fetch, insert, update, and delete. For a view, waits are associated with base tables referenced by the view.
与大多数等待不同,表 I/O 等待可以包含其他等待。例如,表 I/O 可能包括文件 I/O 或内存操作。因此,
events_waits_current中的表 I/O 等待通常有两行。有关更多信息,请参见 第 29.8 节,“性能模式原子和分子事件”。Unlike most waits, a table I/O wait can include other waits. For example, table I/O might include file I/O or memory operations. Thus,events_waits_currentfor a table I/O wait usually has two rows. For more information, see Section 29.8, “Performance Schema Atom and Molecule Events”.某些行操作可能会导致多次表 I/O 等待。例如,插入操作可能会触发导致更新的触发器。Some row operations might cause multiple table I/O waits. For example, an insert might activate a trigger that causes an update.
wait/lock一个带有监控的锁操作。An instrumented lock operation.
wait/lock/table一个带有监控的表锁操作。An instrumented table lock operation.
wait/lock/metadata/sql/mdl一个带有监控的元数据锁操作。An instrumented metadata lock operation.
wait/synch一个带有监控的同步对象。对于同步对象,
TIMER_WAIT时间包括尝试获取对象锁时被阻塞的时间(如果有的话)。An instrumented synchronization object. For synchronization objects, theTIMER_WAITtime includes the amount of time blocked while attempting to acquire a lock on the object, if any.wait/synch/cond条件用于让一个线程向其他线程发出信号,表示它们正在等待的某件事情已经发生。如果只有一个线程在等待条件,它可以被唤醒并继续执行。如果有多个线程在等待,它们都可以被唤醒并竞争它们所等待的资源。A condition is used by one thread to signal to other threads that something they were waiting for has happened. If a single thread was waiting for a condition, it can wake up and proceed with its execution. If several threads were waiting, they can all wake up and compete for the resource for which they were waiting.
wait/synch/mutex互斥对象用于允许访问资源(例如一段可执行代码)同时防止其他线程访问该资源。A mutual exclusion object used to permit access to a resource (such as a section of executable code) while preventing other threads from accessing the resource.
wait/synch/prlockwait/synch/rwlock一个普通的读/写锁对象,用于锁定特定变量以便访问,同时防止其他线程使用它。共享读锁可以被多个线程同时获取。排他写锁一次只能被一个线程获取。A plain read/write lock object used to lock a specific variable for access while preventing its use by other threads. A shared read lock can be acquired simultaneously by multiple threads. An exclusive write lock can be acquired by only one thread at a time.
wait/synch/sxlock共享-排他(SX)锁是一种读/写锁对象,它在允许其他线程进行不一致读取的同时提供对公共资源的写访问。
sxlocks优化并发性并提高读写工作负载的可扩展性。A shared-exclusive (SX) lock is a type of rwlock lock object that provides write access to a common resource while permitting inconsistent reads by other threads.sxlocksoptimize concurrency and improve scalability for read-write workloads.