35.4.3 Server Metrics
MySQL 8.4 Reference Manual Including MySQL NDB Cluster 8.4
35.4.3 Server Metrics
The following server metrics are registered by default:
- mysql.stats Metrics
- mysql.stats.com Metrics
- mysql.stats.connection Metrics
- mysql.perf_schema Metrics
- mysql.stats.handler Metrics
- mysql.stats.myisam Metrics
- mysql.stats.ssl Metrics
- mysql.inno Metrics
- mysql.inno.buffer_pool Metrics
- mysql.inno.data Metrics
- mysql.x Metrics
- mysql.x.stmt Metrics
The maximum number of metric instruments which can be created is
set by
performance_schema_max_metric_classes.
mysql.stats Metrics
Table 35.3 mysql.stats Metrics
| Name | Source Variable | OTEL Type | Description |
|---|---|---|---|
aborted_clients |
Aborted_clients |
ASYNC COUNTER |
The number of connections that were aborted because the client died without closing the connection properly |
aborted_connects |
Aborted_connects |
ASYNC COUNTER |
The number of failed attempts to connect to the MySQL server |
acl_cache_items_count |
Acl_cache_items_count |
ASYNC GAUGE COUNTER |
The number of cached privilege objects |
binlog_cache.disk_use |
Binlog_cache_disk_use |
ASYNC COUNTER |
The number of transactions that used the temporary binary log cache but that exceeded the value of binlog_cache_size and used a temporary file to store statements from the transaction |
binlog_cache.use |
Binlog_cache_use |
ASYNC COUNTER |
The number of transactions that used the binary log cache. |
binlog_stmt_cache_disk_use |
Binlog_stmt_cache_disk_use |
ASYNC COUNTER |
The number of nontransaction statements that used the binary log statement cache but that exceeded the value of binlog_stmt_cache_size and used a temporary file to store those statements. |
binlog_stmt_cache_use |
Binlog_stmt_cache_use |
ASYNC COUNTER |
The number of nontransactional statements that used the binary log statement cache |
bytes_received |
Bytes_received |
ASYNC COUNTER |
The number of bytes received from all clients |
bytes_sent |
Bytes_sent |
ASYNC COUNTER |
The number of bytes sent to all clients |
created.tmp_disk_tables |
Created_tmp_disk_tables |
ASYNC COUNTER |
The number of internal on-disk temporary tables created by the server while executing statements |
created.tmp_files |
Created_tmp_files |
ASYNC COUNTER |
How many temporary files mysqld has created |
created.tmp_tables |
Created_tmp_tables |
ASYNC COUNTER |
The number of internal temporary tables created by the server while executing statements |
error_log.buffered_bytes |
Error_log_buffered_bytes |
ASYNC GAUGE COUNTER |
The number of bytes currently used in the Performance Schema error_log table |
error_log.buffered_events |
Error_log_buffered_events |
ASYNC GAUGE COUNTER |
The number of events currently present in the Performance Schema error_log table |
error_log.expired_events |
Error_log_expired_events |
ASYNC COUNTER |
The number of events discarded from the Performance Schema error_log table to make room for new events |
flush_commands |
Flush_commands |
ASYNC COUNTER |
The number of times the server flushes tables |
global_connection_memory |
Global_connection_memory |
ASYNC GAUGE COUNTER |
The memory used by all user connections to the server |
locked_connects |
Locked_connects |
ASYNC COUNTER |
The number of attempts to connect to locked user accounts |
max_execution_time_exceeded |
Max_execution_time_exceeded |
ASYNC COUNTER |
The number of SELECT statements for which the execution timeout was exceeded |
max_execution_time_set |
Max_execution_time_set |
ASYNC COUNTER |
The number of SELECT statements for which a nonzero execution timeout was set |
max_execution_time_set_failed |
Max_execution_time_set_failed |
ASYNC COUNTER |
The number of SELECT statements for which the attempt to set an execution timeout failed |
max_used_connections |
Max_used_connections |
ASYNC GAUGE COUNTER |
The maximum number of connections that have been in use simultaneously since the server started |
ongoing_anonymous_transaction_count |
Ongoing_anonymous_transaction_count |
ASYNC GAUGE COUNTER |
Shows the number of ongoing transactions which have been marked as anonymous |
open_files |
Open_files |
ASYNC COUNTER |
The number of files that are open. This count includes regular files opened by the server. |
open_streams |
Open_streams |
ASYNC COUNTER |
The number of streams that are open, used mainly for logging |
open_table_definitions |
Open_table_definitions |
ASYNC GAUGE COUNTER |
The number of cached table definitions |
open_tables |
Open_tables |
ASYNC GAUGE COUNTER |
The number of tables that are open. |
opened_files |
Opened_files |
ASYNC COUNTER |
The number of files that have been opened with my_open(). |
opened_table_definitions |
Opened_table_definitions |
ASYNC GAUGE COUNTER |
The number of table definitions that have been cached. |
opened_tables |
Opened_tables |
ASYNC COUNTER |
The number of tables that have been opened |
prepared_stmt_count |
Prepared_stmt_count |
ASYNC GAUGE COUNTER |
The current number of prepared statements |
queries |
Queries |
ASYNC COUNTER |
The number of statements executed by the server, including ones executed within stored programs. It does not count COM_PING or COM_STATISTICS commands. |
questions |
Questions |
ASYNC COUNTER |
The number of statements executed by the server. This includes only statements sent to the server by clients and not statements executed within stored programs. |
replica_open_temp_tables |
Replica_open_temp_tables |
ASYNC GAUGE COUNTER |
Number of temporary tables that the replication SQL thread currently has open. |
secondary_engine_execution_count |
Secondary_engine_execution_count |
ASYNC COUNTER |
The number of queries offloaded to a secondary engine |
select_full_join |
Select_full_join |
ASYNC COUNTER |
The number of joins that perform table scans because they do not use indexes |
select_full_range_join |
Select_full_range_join |
ASYNC COUNTER |
The number of joins that used a range search on a reference table |
select_range |
Select_range |
ASYNC COUNTER |
The number of joins that used ranges on the first table |
select_range_check |
Select_range_check |
ASYNC COUNTER |
The number of joins without keys that check for key usage after each row |
select_scan |
Select_scan |
ASYNC COUNTER |
The number of joins that did a full scan of the first table |
slow_launch_threads |
Slow_launch_threads |
ASYNC COUNTER |
The number of threads that have taken more than slow_launch_time seconds to create. |
slow_queries |
Slow_queries |
ASYNC COUNTER |
The number of queries that have taken more than long_query_time seconds |
sort_merge_passes |
Sort_merge_passes |
ASYNC COUNTER |
The number of merge passes that the sort algorithm has had to do |
sort_range |
Sort_range |
ASYNC COUNTER |
The number of sorts that were done using ranges |
sort_rows |
Sort_rows |
ASYNC COUNTER |
The number of sorted rows. |
sort_scan |
Sort_scan |
ASYNC COUNTER |
The number of sorts that were done by scanning the table. |
table_locks_immediate |
Table_locks_immediate |
ASYNC COUNTER |
The number of times that a request for a table lock could be granted immediately |
table_locks_waited |
Table_locks_waited |
ASYNC COUNTER |
The number of times that a request for a table lock could not be granted immediately and a wait was needed. |
table_open_cache_hits |
Table_open_cache_hits |
ASYNC COUNTER |
The number of hits for open tables cache lookups. |
table_open_cache_misses |
Table_open_cache_misses |
ASYNC COUNTER |
The number of misses for open tables cache lookups. |
table_open_cache_overflows |
Table_open_cache_overflows |
ASYNC COUNTER |
The number of overflows for the open tables cache. |
tc_log_page_waits |
Tc_log_page_waits |
ASYNC COUNTER |
For the memory-mapped implementation of the recovery log, this variable increments each time the server was not able to commit a transaction and had to wait for a free page in the log. |
threads_cached |
Threads_cached |
ASYNC GAUGE COUNTER |
The number of threads in the thread cache. |
threads_connected |
Threads_connected |
ASYNC GAUGE COUNTER |
The number of currently open connections |
threads_created |
Threads_created |
ASYNC GAUGE COUNTER |
The number of threads created to handle connections. |
threads_running |
Threads_running |
ASYNC GAUGE COUNTER |
The number of threads that are not sleeping. |
uptime |
Uptime |
ASYNC COUNTER |
The number of seconds that the server has been up. |
mysql.stats.com Metrics
The mysql.stats.com metrics correspond to
the Com_xxx
statement counter variables. See
Section 7.1.10, “Server Status Variables” and
Com_xxxfor more
information.
The mysql.stats.com metrics are named for
those variables, without the Com_ prefix.
For example, the select metric corresponds
to the Com_select statement counter
variable.
These metrics are of OTEL Type ASYNC
COUNTER and record the number of times (INTEGER) the
corresponding command statement has been executed.
mysql.stats.connection Metrics
The mysql.stats.connection metrics
correspond to the Connections and
Connection_XXX
status variables.
Table 35.4 mysql.stats.connection Metrics
| Name | Source Variable | OTEL Type | Description |
|---|---|---|---|
total |
Connections |
ASYNC COUNTER |
Cumulative count of total connections created. |
errors_accept |
Connection_errors_accept |
ASYNC COUNTER |
The number of errors that occurred during calls to accept() on the listening port. |
errors_internal |
Connection_errors_internal |
ASYNC COUNTER |
The number of connections refused due to internal errors in the server, such as failure to start a new thread or an out-of-memory condition. |
errors_max_connections |
Connection_errors_max_connections |
ASYNC COUNTER |
The number of connections refused because the server max_connections limit was reached. |
errors_peer_address |
Connection_errors_peer_address |
ASYNC COUNTER |
The number of errors that occurred while searching for connecting client IP addresses. |
errors_select |
Connection_errors_select |
ASYNC COUNTER |
The number of errors that occurred during calls to select() or poll() on the listening port. |
errors_tcpwrap |
Connection_errors_tcpwrap |
ASYNC COUNTER |
The number of connections refused by the libwrap library. |
mysql.perf_schema Metrics
The mysql.perf_schema correspond to the
Performance_schema_XXX
status variables. See
Section 29.7, “Performance Schema Status Monitoring”.
Table 35.5 mysql.perf_schema Metrics
| Name | Source Variable | OTEL Type | Description |
|---|---|---|---|
accounts_lost |
Performance_schema_accounts_lost |
ASYNC COUNTER |
The number of times a row could not be added to the accounts table because it was full. |
cond_classes_lost |
Performance_schema_cond_classes_lost |
ASYNC COUNTER |
How many condition instruments could not be loaded. |
cond_instances_lost |
Performance_schema_cond_instances_lost |
ASYNC COUNTER |
How many condition instrument instances could not be created. |
digest_lost |
Performance_schema_digest_lost |
ASYNC COUNTER |
The number of digest instances that could not be instrumented in the events_statements_summary_by_digest table. |
file_classes_lost |
Performance_schema_file_classes_lost |
ASYNC COUNTER |
How many file instruments could not be loaded. |
file_handles_lost |
Performance_schema_file_handles_lost |
ASYNC COUNTER |
How many file instrument instances could not be opened. |
file_instances_lost |
Performance_schema_file_instances_lost |
ASYNC COUNTER |
How many file instrument instances could not be created. |
hosts_lost |
Performance_schema_hosts_lost |
ASYNC COUNTER |
The number of times a row could not be added to the hosts table because it was full. |
index_stat_lost |
Performance_schema_index_stat_lost |
ASYNC COUNTER |
The number of indexes for which statistics were lost. |
locker_lost |
Performance_schema_locker_lost |
ASYNC COUNTER |
How many events are lost or not recorded. |
memory_classes_lost |
Performance_schema_memory_classes_lost |
ASYNC COUNTER |
The number of times a memory instrument could not be loaded. |
metadata_lock_lost |
Performance_schema_metadata_lock_lost |
ASYNC COUNTER |
The number of metadata locks that could not be instrumented in the metadata_locks table. |
meter_lost |
Performance_schema_meter_lost |
ASYNC COUNTER |
How many meter instruments could not be loaded. |
metric_lost |
Performance_schema_metric_lost |
ASYNC COUNTER |
How many metric instruments could not be loaded. |
mutex_classes_lost |
Performance_schema_mutex_classes_lost |
ASYNC COUNTER |
How many mutex instruments could not be loaded. |
mutex_instances_lost |
Performance_schema_mutex_instances_lost |
ASYNC COUNTER |
How many mutex instrument instances could not be created. |
nested_statement_lost |
Performance_schema_nested_statement_lost |
ASYNC COUNTER |
The number of stored program statements for which statistics were lost. |
prepared_statements_lost |
Performance_schema_prepared_statements_lost |
ASYNC COUNTER |
The number of prepared statements that could not be instrumented in the prepared_statements_instances table. |
program_lost |
Performance_schema_program_lost |
ASYNC COUNTER |
The number of stored programs for which statistics were lost. |
rwlock_classes_lost |
Performance_schema_rwlock_classes_lost |
ASYNC COUNTER |
How many rwlock instruments could not be loaded. |
rwlock_instances_lost |
Performance_schema_rwlock_instances_lost |
ASYNC COUNTER |
How many rwlock instrument instances could not be created. |
session_connect_attrs_longest_seen |
Performance_schema_session_connect_attrs_longest_seen |
ASYNC COUNTER |
Longest seen connection attribute received. |
session_connect_attrs_lost |
Performance_schema_session_connect_attrs_lost |
ASYNC COUNTER |
The number of connections for which connection attribute truncation has occurred |
socket_classes_lost |
Performance_schema_socket_classes_lost |
ASYNC COUNTER |
How many socket instruments could not be loaded. |
socket_instances_lost |
Performance_schema_socket_instances_lost |
ASYNC COUNTER |
How many socket instrument instances could not be created. |
stage_classes_lost |
Performance_schema_stage_classes_lost |
ASYNC COUNTER |
How many stage instruments could not be loaded. |
statement_classes_lost |
Performance_schema_statement_classes_lost |
ASYNC COUNTER |
How many statement instruments could not be loaded. |
table_handles_lost |
Performance_schema_table_handles_lost |
ASYNC COUNTER |
How many table instrument instances could not be opened. |
table_instances_lost |
Performance_schema_table_instances_lost |
ASYNC COUNTER |
How many table instrument instances could not be created. |
table_lock_stat_lost |
Performance_schema_table_lock_stat_lost |
ASYNC COUNTER |
The number of tables for which lock statistics were lost. |
thread_classes_lost |
Performance_schema_thread_classes_lost |
ASYNC COUNTER |
How many thread instruments could not be loaded. |
thread_instances_lost |
Performance_schema_thread_instances_lost |
ASYNC COUNTER |
The number of thread instances that could not be instrumented in the threads table. |
users_lost |
Performance_schema_users_lost |
ASYNC COUNTER |
The number of times a row could not be added to the users table because it was full. |
mysql.stats.handler Metrics
The mysql.stats.handler metrics correspond
to the
Handler_XXX
status variables.
Table 35.6 mysql.perf_schema Metrics
| Name | Source Variable | OTEL Type | Description |
|---|---|---|---|
commit |
Handler_commit |
ASYNC COUNTER |
The number of internal COMMIT statements. |
delete |
Handler_delete |
ASYNC COUNTER |
The number of times that rows have been deleted from tables |
discover |
Handler_discover |
ASYNC COUNTER |
The number of times that tables have been discovered. |
external_lock |
Handler_external_lock |
ASYNC COUNTER |
The server increments this variable for each call to its external_lock() function, which generally occurs at the beginning and end of access to a table instance. |
mrr_init |
Handler_mrr_init |
ASYNC COUNTER |
The number of times the server uses a storage engine's own Multi-Range Read implementation for table access. |
prepare |
Handler_prepare |
ASYNC COUNTER |
A counter for the prepare phase of two-phase commit operations. |
read_first |
Handler_read_first |
ASYNC COUNTER |
The number of times the first entry in an index was read. |
read_key |
Handler_read_key |
ASYNC COUNTER |
The number of requests to read a row based on a key. |
read_last |
Handler_read_last |
ASYNC COUNTER |
The number of requests to read the last key in an index. |
read_next |
Handler_read_next |
ASYNC COUNTER |
The number of requests to read the next row in key order. |
read_prev |
Handler_read_prev |
ASYNC COUNTER |
The number of requests to read the previous row in key order. |
read_rnd |
Handler_read_rnd |
ASYNC COUNTER |
The number of requests to read a row based on a fixed position. |
read_rnd_next |
Handler_read_rnd_next |
ASYNC COUNTER |
The number of requests to read the next row in the data file. |
rollback |
Handler_rollback |
ASYNC COUNTER |
The number of requests for a storage engine to perform a rollback operation. |
savepoint |
Handler_savepoint |
ASYNC COUNTER |
The number of requests for a storage engine to place a savepoint. |
savepoint_rollback |
Handler_savepoint_rollback |
ASYNC COUNTER |
The number of requests for a storage engine to roll back to a savepoint. |
update |
Handler_update |
ASYNC COUNTER |
The number of requests to update a row in a table. |
write |
Handler_write |
ASYNC COUNTER |
The number of requests to insert a row in a table. |
mysql.stats.myisam Metrics
Table 35.7 mysql.perf_schema Metrics
| Name | Source Variable | OTEL Type | Description |
|---|---|---|---|
key_blocks_not_flushed |
Key_blocks_not_flushed |
ASYNC COUNTER |
The number of key blocks in the MyISAM key cache that have changed but have not yet been flushed to disk. |
key_blocks_unused |
Key_blocks_unused |
ASYNC COUNTER |
The number of unused blocks in the MyISAM key cache. |
key_blocks_used |
Key_blocks_used |
ASYNC COUNTER |
The number of used blocks in the MyISAM key cache. |
key_read_requests |
Key_read_requests |
ASYNC COUNTER |
The number of requests to read a key block from the MyISAM key cache. |
key_reads |
Key_reads |
ASYNC COUNTER |
The number of physical reads of a key block from disk into the MyISAM key cache. |
key_write_requests |
Key_write_requests |
ASYNC COUNTER |
The number of requests to write a key block to the MyISAM key cache. |
key_writes |
Key_writes |
ASYNC COUNTER |
The number of physical writes of a key block from the MyISAM key cache to disk. |
mysql.stats.ssl Metrics
Table 35.8 mysql.stats.ssl Metrics
| Name | Source Variable | OTEL Type | Description |
|---|---|---|---|
client_connects |
Ssl_client_connects |
ASYNC COUNTER |
The number of SSL connection attempts to an SSL-enabled replication source server. |
connect_renegotiates |
Ssl_connect_renegotiates |
ASYNC COUNTER |
The number of negotiates needed to establish the connection to an SSL-enabled replication source server. |
finished_accepts |
Ssl_finished_accepts |
ASYNC COUNTER |
The number of successful SSL connections to the server. |
finished_connects |
Ssl_finished_connects |
ASYNC COUNTER |
The number of successful replica connections to an SSL-enabled replication source server. |
session_cache_hits |
Ssl_session_cache_hits |
ASYNC COUNTER |
The number of SSL session cache hits. |
session_cache_misses |
Ssl_session_cache_misses |
ASYNC COUNTER |
The number of SSL session cache misses. |
session_cache_overflows |
Ssl_session_cache_overflows |
ASYNC COUNTER |
The number of SSL session cache overflows. |
session_cache_size |
Ssl_session_cache_size |
ASYNC COUNTER |
The SSL session cache size. |
session_cache_timeouts |
Ssl_session_cache_timeouts |
ASYNC COUNTER |
The number of SSL session cache timeouts. |
used_session_cache_entries |
Ssl_used_session_cache_entries |
ASYNC COUNTER |
How many SSL session cache entries were used. |
accept_renegotiates |
Ssl_accept_renegotiates |
ASYNC COUNTER |
The number of negotiates needed to establish the connection. |
accepts |
Ssl_accepts |
ASYNC COUNTER |
The number of accepted SSL connections. |
callback_cache_hits |
Ssl_callback_cache_hits |
ASYNC COUNTER |
The number of callback cache hits. |
mysql.inno Metrics
Table 35.9 mysql.inno Metrics
| Name | Source Variable | OTEL Type | Description |
|---|---|---|---|
dblwr_pages_written |
Innodb_dblwr_pages_written |
ASYNC COUNTER |
Number of pages that have been written for doublewrite operations |
dblwr_writes |
Innodb_dblwr_writes |
ASYNC COUNTER |
Number of doublewrite operations that have been performed |
redo_log_logical_size |
Innodb_redo_log_logical_size |
ASYNC GAUGE COUNTER |
LSN range size in bytes containing in-use redo log data. |
redo_log_physical_size |
Innodb_redo_log_physical_size |
ASYNC GAUGE COUNTER |
Disk space in bytes currently consumed by all redo log files on disk, excluding spare redo log files |
redo_log_capacity_resized |
Innodb_redo_log_capacity_resized |
ASYNC GAUGE COUNTER |
Redo log capacity in bytes for all redo log files, after the last completed capacity resize operation |
log_waits |
Innodb_log_waits |
ASYNC COUNTER |
Number of log waits due to small log buffer |
log_write_requests |
Innodb_log_write_requests |
ASYNC COUNTER |
Number of log write requests |
log_writes |
Innodb_log_writes |
ASYNC COUNTER |
The number of physical writes to the InnoDB redo log file |
os_log_fsyncs |
Innodb_os_log_fsyncs |
ASYNC COUNTER |
Number of fsync log writes. |
os_log_pending_fsyncs |
Innodb_os_log_pending_fsyncs |
ASYNC GAUGE COUNTER |
Number of pending fsync writes. |
os_log_pending_writes |
Innodb_os_log_pending_writes |
ASYNC GAUGE COUNTER |
Number of pending log file writes. |
os_log_written |
Innodb_os_log_written |
ASYNC COUNTER |
Bytes of log written. |
page_size |
Innodb_page_size |
ASYNC GAUGE COUNTER |
InnoDB page size in bytes. |
pages_created |
Innodb_pages_created |
ASYNC COUNTER |
Number of pages created |
pages_read |
Innodb_pages_read |
ASYNC COUNTER |
Number of pages read. |
pages_written |
Innodb_pages_written |
ASYNC COUNTER |
Number of pages written. |
row_lock_current_waits |
Innodb_row_lock_current_waits |
ASYNC GAUGE COUNTER |
Number of row locks currently being waited for. |
row_lock_time |
Innodb_row_lock_time |
ASYNC COUNTER |
Time spent in acquiring row locks, in milliseconds |
row_lock_time_avg |
Innodb_row_lock_time_avg |
ASYNC GAUGE COUNTER |
The average time to acquire a row lock, in milliseconds |
row_lock_time_max |
Innodb_row_lock_time_max |
ASYNC GAUGE COUNTER |
The maximum time to acquire a row lock, in milliseconds. |
row_lock_waits |
Innodb_row_lock_waits |
ASYNC COUNTER |
Number of times a row lock had to be waited for. |
rows_deleted |
[`Innodb_rows_delete |
(本文超出站点单文档体积上限,已截断)
