21 #include "my_global.h"
22 #include "my_pthread.h"
29 THR_LOCK table_events_waits_summary_by_instance::m_table_lock;
34 { C_STRING_WITH_LEN(
"EVENT_NAME") },
35 { C_STRING_WITH_LEN(
"varchar(128)") },
39 { C_STRING_WITH_LEN(
"OBJECT_INSTANCE_BEGIN") },
40 { C_STRING_WITH_LEN(
"bigint(20)") },
44 { C_STRING_WITH_LEN(
"COUNT_STAR") },
45 { C_STRING_WITH_LEN(
"bigint(20)") },
49 { C_STRING_WITH_LEN(
"SUM_TIMER_WAIT") },
50 { C_STRING_WITH_LEN(
"bigint(20)") },
54 { C_STRING_WITH_LEN(
"MIN_TIMER_WAIT") },
55 { C_STRING_WITH_LEN(
"bigint(20)") },
59 { C_STRING_WITH_LEN(
"AVG_TIMER_WAIT") },
60 { C_STRING_WITH_LEN(
"bigint(20)") },
64 { C_STRING_WITH_LEN(
"MAX_TIMER_WAIT") },
65 { C_STRING_WITH_LEN(
"bigint(20)") },
71 table_events_waits_summary_by_instance::m_field_def=
72 { 7, ews_by_instance_field_types };
77 { C_STRING_WITH_LEN(
"events_waits_summary_by_instance") },
79 &table_events_waits_summary_by_instance::create,
81 &table_events_waits_summary_by_instance::delete_all_rows,
95 int table_events_waits_summary_by_instance::delete_all_rows(
void)
101 table_events_waits_summary_by_instance
102 ::table_events_waits_summary_by_instance()
106 void table_events_waits_summary_by_instance
108 const void *object_instance_begin,
138 safe_class= sanitize_mutex_class(pfs->
m_class);
139 if (unlikely(safe_class == NULL))
152 safe_class= sanitize_rwlock_class(pfs->
m_class);
153 if (unlikely(safe_class == NULL))
166 safe_class= sanitize_cond_class(pfs->
m_class);
167 if (unlikely(safe_class == NULL))
180 safe_class= sanitize_file_class(pfs->
m_class);
181 if (unlikely(safe_class == NULL))
190 make_instr_row(pfs, safe_class, pfs, & sum);
200 safe_class= sanitize_socket_class(pfs->
m_class);
201 if (unlikely(safe_class == NULL))
215 make_instr_row(pfs, safe_class, pfs, &pfs_stat);
224 if (unlikely(! m_row_exists))
225 return HA_ERR_RECORD_DELETED;
228 DBUG_ASSERT(table->s->null_bytes == 0);
230 for (; (f= *fields) ; fields++)
232 if (read_all || bitmap_is_set(table->read_set, f->field_index))
234 switch(f->field_index)
237 set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
240 set_field_ulonglong(f, m_row.m_object_instance_addr);
243 set_field_ulonglong(f, m_row.m_stat.m_count);
246 set_field_ulonglong(f, m_row.m_stat.m_sum);
249 set_field_ulonglong(f, m_row.m_stat.m_min);
252 set_field_ulonglong(f, m_row.m_stat.m_avg);
255 set_field_ulonglong(f, m_row.m_stat.m_max);