16 #ifndef PFS_TABLE_HELPER_H
17 #define PFS_TABLE_HELPER_H
30 #define MD5_HASH_TO_STRING(_hash, _str) \
31 sprintf(_str, "%02x%02x%02x%02x%02x%02x%02x%02x" \
32 "%02x%02x%02x%02x%02x%02x%02x%02x", \
33 _hash[0], _hash[1], _hash[2], _hash[3], \
34 _hash[4], _hash[5], _hash[6], _hash[7], \
35 _hash[8], _hash[9], _hash[10], _hash[11], \
36 _hash[12], _hash[13], _hash[14], _hash[15])
38 #define MD5_HASH_TO_STRING_LENGTH 32
57 static const uint FIRST_VIEW= 1;
58 static const uint VIEW_MUTEX= 1;
59 static const uint VIEW_RWLOCK= 2;
60 static const uint VIEW_COND= 3;
61 static const uint VIEW_FILE= 4;
62 static const uint VIEW_TABLE= 5;
63 static const uint VIEW_SOCKET= 6;
64 static const uint VIEW_IDLE= 7;
65 static const uint LAST_VIEW= 7;
71 static const uint FIRST_VIEW= 1;
72 static const uint VIEW_TABLE= 1;
73 static const uint LAST_VIEW= 1;
76 static const uint VIEW_EVENT= 2;
77 static const uint VIEW_PROCEDURE= 3;
78 static const uint VIEW_FUNCTION= 4;
225 if ((
m_count != 0) && stat->has_timed_stats())
227 m_sum= normalizer->wait_to_pico(stat->m_sum);
228 m_min= normalizer->wait_to_pico(stat->m_min);
229 m_max= normalizer->wait_to_pico(stat->m_max);
276 m_waits.
set(normalizer, stat);
277 m_bytes= stat->m_bytes;
299 m_fetch.
set(normalizer, & stat->m_fetch);
301 all_read.aggregate(& stat->m_fetch);
303 m_insert.
set(normalizer, & stat->m_insert);
304 m_update.
set(normalizer, & stat->m_update);
305 m_delete.
set(normalizer, & stat->m_delete);
307 all_write.aggregate(& stat->m_insert);
308 all_write.aggregate(& stat->m_update);
309 all_write.aggregate(& stat->m_delete);
311 all.aggregate(& all_read);
312 all.aggregate(& all_write);
314 m_all_read.
set(normalizer, & all_read);
315 m_all_write.
set(normalizer, & all_write);
316 m_all.
set(normalizer, & all);
345 m_read_normal.
set(normalizer, & stat->m_stat[PFS_TL_READ]);
346 m_read_with_shared_locks.
set(normalizer, & stat->m_stat[PFS_TL_READ_WITH_SHARED_LOCKS]);
347 m_read_high_priority.
set(normalizer, & stat->m_stat[PFS_TL_READ_HIGH_PRIORITY]);
348 m_read_no_insert.
set(normalizer, & stat->m_stat[PFS_TL_READ_NO_INSERT]);
349 m_read_external.
set(normalizer, & stat->m_stat[PFS_TL_READ_EXTERNAL]);
351 all_read.aggregate(& stat->m_stat[PFS_TL_READ]);
352 all_read.aggregate(& stat->m_stat[PFS_TL_READ_WITH_SHARED_LOCKS]);
353 all_read.aggregate(& stat->m_stat[PFS_TL_READ_HIGH_PRIORITY]);
354 all_read.aggregate(& stat->m_stat[PFS_TL_READ_NO_INSERT]);
355 all_read.aggregate(& stat->m_stat[PFS_TL_READ_EXTERNAL]);
357 m_write_allow_write.
set(normalizer, & stat->m_stat[PFS_TL_WRITE_ALLOW_WRITE]);
358 m_write_concurrent_insert.
set(normalizer, & stat->m_stat[PFS_TL_WRITE_CONCURRENT_INSERT]);
359 m_write_delayed.
set(normalizer, & stat->m_stat[PFS_TL_WRITE_DELAYED]);
360 m_write_low_priority.
set(normalizer, & stat->m_stat[PFS_TL_WRITE_LOW_PRIORITY]);
361 m_write_normal.
set(normalizer, & stat->m_stat[PFS_TL_WRITE]);
362 m_write_external.
set(normalizer, & stat->m_stat[PFS_TL_WRITE_EXTERNAL]);
364 all_write.aggregate(& stat->m_stat[PFS_TL_WRITE_ALLOW_WRITE]);
365 all_write.aggregate(& stat->m_stat[PFS_TL_WRITE_CONCURRENT_INSERT]);
366 all_write.aggregate(& stat->m_stat[PFS_TL_WRITE_DELAYED]);
367 all_write.aggregate(& stat->m_stat[PFS_TL_WRITE_LOW_PRIORITY]);
368 all_write.aggregate(& stat->m_stat[PFS_TL_WRITE]);
369 all_write.aggregate(& stat->m_stat[PFS_TL_WRITE_EXTERNAL]);
371 all.aggregate(& all_read);
372 all.aggregate(& all_write);
374 m_all_read.
set(normalizer, & all_read);
375 m_all_write.
set(normalizer, & all_write);
376 m_all.
set(normalizer, & all);
388 m_timer1_row.
set(normalizer, & stat->m_timer1_stat);
402 ulonglong m_error_count;
403 ulonglong m_warning_count;
404 ulonglong m_rows_affected;
405 ulonglong m_lock_time;
406 ulonglong m_rows_sent;
407 ulonglong m_rows_examined;
408 ulonglong m_created_tmp_disk_tables;
409 ulonglong m_created_tmp_tables;
410 ulonglong m_select_full_join;
411 ulonglong m_select_full_range_join;
412 ulonglong m_select_range;
413 ulonglong m_select_range_check;
414 ulonglong m_select_scan;
415 ulonglong m_sort_merge_passes;
416 ulonglong m_sort_range;
417 ulonglong m_sort_rows;
418 ulonglong m_sort_scan;
419 ulonglong m_no_index_used;
420 ulonglong m_no_good_index_used;
425 m_timer1_row.
set(normalizer, & stat->m_timer1_stat);
427 m_error_count= stat->m_error_count;
428 m_warning_count= stat->m_warning_count;
430 m_rows_affected= stat->m_rows_affected;
431 m_rows_sent= stat->m_rows_sent;
432 m_rows_examined= stat->m_rows_examined;
433 m_created_tmp_disk_tables= stat->m_created_tmp_disk_tables;
434 m_created_tmp_tables= stat->m_created_tmp_tables;
435 m_select_full_join= stat->m_select_full_join;
436 m_select_full_range_join= stat->m_select_full_range_join;
437 m_select_range= stat->m_select_range;
438 m_select_range_check= stat->m_select_range_check;
439 m_select_scan= stat->m_select_scan;
440 m_sort_merge_passes= stat->m_sort_range;
441 m_sort_range= stat->m_sort_range;
442 m_sort_rows= stat->m_sort_rows;
443 m_sort_scan= stat->m_sort_scan;
444 m_no_index_used= stat->m_no_index_used;
445 m_no_good_index_used= stat->m_no_good_index_used;
454 ulonglong m_current_connections;
455 ulonglong m_total_connections;
459 m_current_connections= stat->m_current_connections;
460 m_total_connections= stat->m_total_connections;
481 m_read.
set(normalizer, &stat->m_read);
482 m_write.
set(normalizer, &stat->m_write);
483 m_misc.
set(normalizer, &stat->m_misc);
486 all.aggregate(&stat->m_read);
487 all.aggregate(&stat->m_write);
488 all.aggregate(&stat->m_misc);
490 m_all.
set(normalizer, &all);
506 m_read.
set(normalizer, &stat->m_read);
507 m_write.
set(normalizer, &stat->m_write);
508 m_misc.
set(normalizer, &stat->m_misc);
511 all.aggregate(&stat->m_read);
512 all.aggregate(&stat->m_write);
513 all.aggregate(&stat->m_misc);
515 m_all.
set(normalizer, &all);