diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-12-10 15:35:00 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2020-03-10 19:24:22 +0100 |
commit | 0ea717f51a152afdb3791195c4a25ee0baa2faac (patch) | |
tree | 0eb10fc1413d1583ffdec2c18a66491d7befeec2 /storage/perfschema/pfs_server.h | |
parent | dfe6e914e58472159f34a8a4c9288ff61eac479f (diff) | |
download | mariadb-git-0ea717f51a152afdb3791195c4a25ee0baa2faac.tar.gz |
P_S 5.7.28
Diffstat (limited to 'storage/perfschema/pfs_server.h')
-rw-r--r-- | storage/perfschema/pfs_server.h | 88 |
1 files changed, 69 insertions, 19 deletions
diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h index 9f904e6545b..68f6f71d619 100644 --- a/storage/perfschema/pfs_server.h +++ b/storage/perfschema/pfs_server.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -28,11 +28,14 @@ Private interface for the server (declarations). */ +#define PFS_AUTOSCALE_VALUE (-1) +#define PFS_AUTOSIZE_VALUE (-1) + #ifndef PFS_MAX_MUTEX_CLASS - #define PFS_MAX_MUTEX_CLASS 200 + #define PFS_MAX_MUTEX_CLASS 210 #endif #ifndef PFS_MAX_RWLOCK_CLASS - #define PFS_MAX_RWLOCK_CLASS 40 + #define PFS_MAX_RWLOCK_CLASS 50 #endif #ifndef PFS_MAX_COND_CLASS #define PFS_MAX_COND_CLASS 90 @@ -41,7 +44,7 @@ #define PFS_MAX_THREAD_CLASS 50 #endif #ifndef PFS_MAX_FILE_CLASS - #define PFS_MAX_FILE_CLASS 50 + #define PFS_MAX_FILE_CLASS 80 #endif #ifndef PFS_MAX_FILE_HANDLE #define PFS_MAX_FILE_HANDLE 32768 @@ -49,28 +52,29 @@ #ifndef PFS_MAX_SOCKET_CLASS #define PFS_MAX_SOCKET_CLASS 10 #endif -#ifndef PFS_MAX_SETUP_ACTOR - #define PFS_MAX_SETUP_ACTOR 100 -#endif -#ifndef PFS_MAX_SETUP_OBJECT - #define PFS_MAX_SETUP_OBJECT 100 -#endif #ifndef PFS_MAX_STAGE_CLASS #define PFS_MAX_STAGE_CLASS 160 #endif #ifndef PFS_STATEMENTS_STACK_SIZE #define PFS_STATEMENTS_STACK_SIZE 10 #endif -#ifndef PFS_CONNECT_ATTRS_SIZE - #define PFS_SESSION_CONNECT_ATTRS_SIZE 2048 +#ifndef PFS_MAX_MEMORY_CLASS + #define PFS_MAX_MEMORY_CLASS 320 #endif +/** Sizing hints, from the server configuration. */ struct PFS_sizing_hints { + /** Value of @c Sys_table_def_size */ long m_table_definition_cache; + /** Value of @c Sys_table_cache_size */ long m_table_open_cache; + /** Value of @c Sys_max_connections */ long m_max_connections; + /** Value of @c Sys_open_files_limit */ long m_open_files_limit; + /** Value of @c Sys_max_prepared_stmt_count */ + long m_max_prepared_stmt_count; }; /** Performance schema global sizing parameters. */ @@ -85,6 +89,9 @@ struct PFS_global_param bool m_consumer_events_statements_current_enabled; bool m_consumer_events_statements_history_enabled; bool m_consumer_events_statements_history_long_enabled; + bool m_consumer_events_transactions_current_enabled; + bool m_consumer_events_transactions_history_enabled; + bool m_consumer_events_transactions_history_long_enabled; bool m_consumer_events_waits_current_enabled; bool m_consumer_events_waits_history_enabled; bool m_consumer_events_waits_history_long_enabled; @@ -121,6 +128,16 @@ struct PFS_global_param */ long m_table_share_sizing; /** + Maximum number of lock statistics collected for tables. + @sa table_lock_stat_lost. + */ + long m_table_lock_stat_sizing; + /** + Maximum number of index statistics collected for tables. + @sa table_index_lost. + */ + long m_index_stat_sizing; + /** Maximum number of instrumented file classes. @sa file_class_lost. */ @@ -162,7 +179,7 @@ struct PFS_global_param long m_file_handle_sizing; /** Maxium number of instrumented socket instances - @sa socket_lost + @sa socket_lost */ long m_socket_sizing; /** @@ -175,9 +192,9 @@ struct PFS_global_param /** Maximum number of rows in table EVENTS_WAITS_HISTORY_LONG. */ long m_events_waits_history_long_sizing; /** Maximum number of rows in table SETUP_ACTORS. */ - ulong m_setup_actor_sizing; + long m_setup_actor_sizing; /** Maximum number of rows in table SETUP_OBJECTS. */ - ulong m_setup_object_sizing; + long m_setup_object_sizing; /** Maximum number of rows in table HOSTS. */ long m_host_sizing; /** Maximum number of rows in table USERS. */ @@ -198,16 +215,36 @@ struct PFS_global_param @sa statement_class_lost. */ ulong m_statement_class_sizing; - /** Maximum number of rows per thread in table EVENTS_STATEMENT_HISTORY. */ + /** Maximum number of rows per thread in table EVENTS_STATEMENTS_HISTORY. */ long m_events_statements_history_sizing; /** Maximum number of rows in table EVENTS_STATEMENTS_HISTORY_LONG. */ long m_events_statements_history_long_sizing; /** Maximum number of digests to be captured */ long m_digest_sizing; + /** Maximum number of programs to be captured */ + long m_program_sizing; + /** Maximum number of prepared statements to be captured */ + long m_prepared_stmt_sizing; + /** Maximum number of rows per thread in table EVENTS_TRANSACTIONS_HISTORY. */ + long m_events_transactions_history_sizing; + /** Maximum number of rows in table EVENTS_TRANSACTIONS_HISTORY_LONG. */ + long m_events_transactions_history_long_sizing; + /** Maximum number of session attribute strings per thread */ long m_session_connect_attrs_sizing; + /** Maximum size of statement stack */ + ulong m_statement_stack_sizing; + + /** + Maximum number of instrumented memory classes. + @sa memory_class_lost. + */ + ulong m_memory_class_sizing; + + long m_metadata_lock_sizing; long m_max_digest_length; + ulong m_max_sql_text_length; /** Sizing hints, for auto tuning. */ PFS_sizing_hints m_hints; @@ -220,9 +257,17 @@ struct PFS_global_param extern PFS_global_param pfs_param; /** + Null initialization. + Disable all instrumentation, size all internal buffers to 0. + This pre initialization step is needed to ensure that events can be collected + and discarded, until such time @c initialize_performance_schema() is called. +*/ +void pre_initialize_performance_schema(); + +/** Initialize the performance schema. @param param Size parameters to use. - @return A boostrap handle, or NULL. + @return A bootstrap handle, or NULL. */ struct PSI_bootstrap* initialize_performance_schema(PFS_global_param *param); @@ -233,14 +278,19 @@ void pfs_automated_sizing(PFS_global_param *param); Initialize the performance schema ACL. ACL is strictly enforced when the server is running in normal mode, to enforce that only legal operations are allowed. - When running in boostrap mode, ACL restrictions are relaxed, - to allow the boostrap scripts to DROP / CREATE performance schema tables. + When running in bootstrap mode, ACL restrictions are relaxed, + to allow the bootstrap scripts to DROP / CREATE performance schema tables. @sa ACL_internal_schema_registry @param bootstrap True if the server is starting in bootstrap mode. */ void initialize_performance_schema_acl(bool bootstrap); /** + Reset the aggregated status counter stats. +*/ +void reset_pfs_status_stats(); + +/** Initialize the dynamic array holding individual instrument settings collected from the server configuration options. */ |