YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftwareFoundation,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
PFS_engine_table_share
table_events_waits_current::m_share=
{
{ C_STRING_WITH_LEN("events_waits_current") },
&pfs_truncatable_acl,
table_events_waits_current::create,
NULL, /* write_row */
table_events_waits_current::delete_all_rows,
table_events_waits_current::get_row_count, sizeof(pos_events_waits_current), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_waits_current(" "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.'," "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.'," "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.'," "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table'," "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.'," "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.'," "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.'," "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.'," "SPINS INTEGER unsigned comment 'Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented.'," "OBJECT_SCHEMA VARCHAR(64) comment 'Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects.'," "OBJECT_NAME VARCHAR(512) comment 'File name for file I/O objects, table name for table I/O objects, the socket''s IP:PORT value for a socket object or NULL for a synchronization object.'," "INDEX_NAME VARCHAR(64) comment 'Name of the index, PRIMARY for the primary key, or NULL for no index used.'," "OBJECT_TYPE VARCHAR(64) comment 'FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object.'," "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory of the object.'," "NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.'," "NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either statement, stage or wait.'," "OPERATION VARCHAR(32) not null comment 'Operation type, for example read, write or lock'," "NUMBER_OF_BYTES BIGINT comment 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.'," "FLAGS INTEGER unsigned comment 'Reserved for use in the future.')") }, false, /* m_perpetual */ false, /* m_optional */
&m_share_state
};
PFS_engine_table_share
table_events_waits_history::m_share=
{
{ C_STRING_WITH_LEN("events_waits_history") },
&pfs_truncatable_acl,
table_events_waits_history::create,
NULL, /* write_row */
table_events_waits_history::delete_all_rows,
table_events_waits_history::get_row_count, sizeof(pos_events_waits_history), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_waits_history(" "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.'," "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.'," "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.'," "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table'," "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.'," "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.'," "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.'," "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.'," "SPINS INTEGER unsigned comment 'Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented.'," "OBJECT_SCHEMA VARCHAR(64) comment 'Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects.'," "OBJECT_NAME VARCHAR(512) comment 'File name for file I/O objects, table name for table I/O objects, the socket''s IP:PORT value for a socket object or NULL for a synchronization object.'," "INDEX_NAME VARCHAR(64) comment 'Name of the index, PRIMARY for the primary key, or NULL for no index used.'," "OBJECT_TYPE VARCHAR(64) comment 'FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object.'," "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory of the object.'," "NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.'," "NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either statement, stage or wait.'," "OPERATION VARCHAR(32) not null comment 'Operation type, for example read, write or lock'," "NUMBER_OF_BYTES BIGINT comment 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.'," "FLAGS INTEGER unsigned comment 'Reserved for use in the future.')") }, false, /* m_perpetual */ false, /* m_optional */
&m_share_state
};
PFS_engine_table_share
table_events_waits_history_long::m_share=
{
{ C_STRING_WITH_LEN("events_waits_history_long") },
&pfs_truncatable_acl,
table_events_waits_history_long::create,
NULL, /* write_row */
table_events_waits_history_long::delete_all_rows,
table_events_waits_history_long::get_row_count, sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_waits_history_long(" "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.'," "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.'," "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.'," "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table'," "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.'," "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.'," "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.'," "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.'," "SPINS INTEGER unsigned comment 'Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented.'," "OBJECT_SCHEMA VARCHAR(64) comment 'Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects.'," "OBJECT_NAME VARCHAR(512) comment 'File name for file I/O objects, table name for table I/O objects, the socket''s IP:PORT value for a socket object or NULL for a synchronization object.'," "INDEX_NAME VARCHAR(64) comment 'Name of the index, PRIMARY for the primary key, or NULL for no index used.'," "OBJECT_TYPE VARCHAR(64) comment 'FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object.'," "OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory of the object.'," "NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.'," "NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either statement, stage or wait.'," "OPERATION VARCHAR(32) not null comment 'Operation type, for example read, write or lock'," "NUMBER_OF_BYTES BIGINT comment 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.'," "FLAGS INTEGER unsigned comment 'Reserved for use in the future.')") }, false, /* m_perpetual */ false, /* m_optional */
&m_share_state
};
/* Get the IP address and port number */
ip_length= pfs_get_socket_address(ip_str, sizeof(ip_str), &port,
&safe_socket->m_sock_addr,
safe_socket->m_addr_len);
/* Convert port number to a string (length includes ':') */
size_t port_len= int10_to_str(port, (port_str+1), 10) - port_str + 1;
/* OBJECT NAME */
m_row.m_object_name_length= ip_length + static_cast<uint>(port_len);
if (unlikely((m_row.m_object_name_length == 0) ||
(m_row.m_object_name_length > sizeof(m_row.m_object_name)))) return1;
int table_events_waits_common::read_row_values(TABLE *table, unsignedchar *buf,
Field **fields, bool read_all)
{
Field *f; const LEX_STRING *operation;
if (safe_current == top_wait)
{ /* Display the last top level wait, when completed */ if (m_pos.m_index_2 >= 1) continue;
} else
{ /* Display all pending waits, when in progress */ if (wait >= safe_current) continue;
} #endif
if (safe_current == top_wait)
{ /* Display the last top level wait, when completed */ if (m_pos.m_index_2 >= 1) return HA_ERR_RECORD_DELETED;
} else
{ /* Display all pending waits, when in progress */ if (wait >= safe_current) return HA_ERR_RECORD_DELETED;
} #endif
int table_events_waits_history::rnd_next(void)
{
PFS_thread *pfs_thread;
PFS_events_waits *wait; bool has_more_thread= true;
if (events_waits_history_per_thread == 0) return HA_ERR_END_OF_FILE;
for (m_pos.set_at(&m_next_pos);
has_more_thread;
m_pos.next_thread())
{
pfs_thread= global_thread_container.get(m_pos.m_index_1, & has_more_thread); if (pfs_thread != NULL)
{ if (m_pos.m_index_2 >= events_waits_history_per_thread)
{ /* This thread does not have more (full) history */ continue;
}
if ( ! pfs_thread->m_waits_history_full &&
(m_pos.m_index_2 >= pfs_thread->m_waits_history_index))
{ /* This thread does not have more (not full) history */ continue;
}
wait= &pfs_thread->m_waits_history[m_pos.m_index_2]; if (wait->m_wait_class != NO_WAIT_CLASS)
{
make_row(pfs_thread, wait); /* Next iteration, look for the next history in this thread */
m_next_pos.set_after(&m_pos); return0;
}
}
}
return HA_ERR_END_OF_FILE;
}
int table_events_waits_history::rnd_pos(constvoid *pos)
{
PFS_thread *pfs_thread;
PFS_events_waits *wait;
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.