YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftwareFoundation,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
#include"my_thread.h"/* For pthread_t */ /* Make sure HAVE_PSI_XXX_INTERFACE flags are set */ #include"mysql/psi/psi.h"
#include <algorithm> using std::min; using std::max;
/** Performance schema sizing heuristics. */ struct PFS_sizing_data
{ /** Default value for @c PFS_param.m_events_waits_history_sizing. */
ulong m_events_waits_history_sizing; /** Default value for @c PFS_param.m_events_waits_history_long_sizing. */
ulong m_events_waits_history_long_sizing; /** Default value for @c PFS_param.m_events_stages_history_sizing. */
ulong m_events_stages_history_sizing; /** Default value for @c PFS_param.m_events_stages_history_long_sizing. */
ulong m_events_stages_history_long_sizing; /** Default value for @c PFS_param.m_events_statements_history_sizing. */
ulong m_events_statements_history_sizing; /** Default value for @c PFS_param.m_events_statements_history_long_sizing. */
ulong m_events_statements_history_long_sizing; /** Default value for @c PFS_param.m_events_transactions_history_sizing. */
ulong m_events_transactions_history_sizing; /** Default value for @c PFS_param.m_events_transactions_history_long_sizing. */
ulong m_events_transactions_history_long_sizing; /** Default value for @c PFS_param.m_digest_sizing. */
ulong m_digest_sizing; /** Default value for @c PFS_param.m_session_connect_attrs_sizing. */
ulong m_session_connect_attrs_sizing;
};
PFS_sizing_data *estimate_hints(PFS_global_param *param)
{ if ((param->m_hints.m_max_connections <= MAX_CONNECTIONS_DEFAULT) &&
(param->m_hints.m_table_definition_cache <= TABLE_DEF_CACHE_DEFAULT) &&
(param->m_hints.m_table_open_cache <= TABLE_OPEN_CACHE_DEFAULT))
{ /* The my.cnf used is either unchanged, or lower than factory defaults. */ return & small_data;
}
if ((param->m_hints.m_max_connections <= MAX_CONNECTIONS_DEFAULT * 2) &&
(param->m_hints.m_table_definition_cache <= TABLE_DEF_CACHE_DEFAULT * 2) &&
(param->m_hints.m_table_open_cache <= TABLE_OPEN_CACHE_DEFAULT * 2))
{ /* Some defaults have been increased, to "moderate" values. */ return & medium_data;
}
/* Looks like a server in production. */ return & large_data;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.