You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my ($running_thread_threshold,$times_per_hour)=$dbh_save->selectrow_array("select running_thread_threshold,times_per_hour from myawr.myawr_host where id=$tid");
483
+
my$times_saved= $dbh_save->selectrow_array("select count(DISTINCT snap_id) cnt from myawr_engine_innodb_status where snap_time>=DATE_ADD(now(),INTERVAL -1 HOUR) and host_id=$tid");
$sql2 = qq{ insert into myawr_innodb_locks(snap_id,host_id,lock_id,lock_trx_id,lock_mode,lock_type,lock_table,lock_index,lock_space,lock_page,lock_rec,lock_data,snap_time) values ($snap_id,$tid,?,?,?,?,?,?,?,?,?,?,?)};
626
+
$sth2 = $dbh_save->prepare( $sql2 );
627
+
628
+
$sth = $dbh->prepare("select lock_id,lock_trx_id,lock_mode,lock_type,lock_table,lock_index,lock_space,lock_page,lock_rec,lock_data from information_schema.INNODB_LOCKS");
629
+
$sth->execute();
630
+
while( my@result2 = $sth->fetchrow_array ) {
631
+
$sth2->bind_param( 1, $result2[0], SQL_VARCHAR );
632
+
$sth2->bind_param( 2, $result2[1], SQL_VARCHAR);
633
+
$sth2->bind_param( 3, $result2[2], SQL_VARCHAR );
634
+
$sth2->bind_param( 4, $result2[3], SQL_VARCHAR );
635
+
$sth2->bind_param( 5, $result2[4], SQL_VARCHAR );
636
+
637
+
$sth2->bind_param( 6, $result2[5], SQL_VARCHAR );
638
+
$sth2->bind_param( 7, $result2[6], SQL_INTEGER );
639
+
$sth2->bind_param( 8, $result2[7], SQL_INTEGER );
640
+
$sth2->bind_param( 9, $result2[8], SQL_INTEGER);
641
+
$sth2->bind_param( 10,$result2[9], SQL_VARCHAR );
642
+
$sth2->bind_param( 11, $snap_time, SQL_DATE );
643
+
$sth2->execute();
644
+
}
645
+
646
+
$sql2 = qq{ insert into myawr_innodb_lock_waits(snap_id,host_id,requesting_trx_id,requested_lock_id,blocking_trx_id,blocking_lock_id,snap_time) values ($snap_id,$tid,?,?,?,?,?)};
647
+
$sth2 = $dbh_save->prepare( $sql2 );
648
+
649
+
$sth = $dbh->prepare("select requesting_trx_id,requested_lock_id,blocking_trx_id,blocking_lock_id from information_schema.INNODB_LOCK_WAITS");
650
+
$sth->execute();
651
+
while( my@result2 = $sth->fetchrow_array ) {
652
+
$sth2->bind_param( 1, $result2[0], SQL_VARCHAR );
653
+
$sth2->bind_param( 2, $result2[1], SQL_VARCHAR);
654
+
$sth2->bind_param( 3, $result2[2], SQL_VARCHAR );
655
+
$sth2->bind_param( 4, $result2[3], SQL_VARCHAR );
656
+
$sth2->bind_param( 5, $snap_time, SQL_DATE );
657
+
$sth2->execute();
658
+
}
659
+
660
+
$sth2->finish;
661
+
}
662
+
663
+
554
664
$sql =
555
665
qq{insert into myawr.myawr_mysql_info(snap_id,host_id,query_cache_size,thread_cache_size,table_definition_cache,max_connections,table_open_cache,slow_launch_time,max_heap_table_size,tmp_table_size,open_files_limit,Max_used_connections,Threads_connected,Threads_cached,Threads_created,Threads_running,Connections,Questions,Com_select,Com_insert,Com_update,Com_delete,Bytes_received,Bytes_sent,Qcache_hits,Qcache_inserts,Select_full_join,Select_scan,Slow_queries,Com_commit,Com_rollback,Open_files,Open_table_definitions,Open_tables,Opened_files,Opened_table_definitions,Opened_tables,Created_tmp_disk_tables,Created_tmp_files,Created_tmp_tables,Binlog_cache_disk_use,Binlog_cache_use,Aborted_clients,Sort_merge_passes,Sort_range,Sort_rows,Sort_scan,Table_locks_immediate,Table_locks_waited,Handler_read_first,Handler_read_key,Handler_read_last,Handler_read_next,Handler_read_prev,Handler_read_rnd,Handler_read_rnd_next,snap_time) values($snap_id,$tid,$vars->{"query_cache_size"},$vars->{"thread_cache_size"},$vars->{"table_definition_cache"},$vars->{"max_connections"},$vars->{"table_open_cache"},$vars->{"slow_launch_time"},$vars->{"max_heap_table_size"},$vars->{"tmp_table_size"},$vars->{"open_files_limit"},$mystat2->{"Max_used_connections"},$mystat2->{"Threads_connected"},$mystat2->{"Threads_cached"},$mystat2->{"Threads_created"},$mystat2->{"Threads_running"},$mystat2->{"Connections"},$mystat2->{"Questions"},$mystat2->{"Com_select"},$mystat2->{"Com_insert"},$mystat2->{"Com_update"},$mystat2->{"Com_delete"},$mystat2->{"Bytes_received"},$mystat2->{"Bytes_sent"},$mystat2->{"Qcache_hits"},$mystat2->{"Qcache_inserts"},$mystat2->{"Select_full_join"},$mystat2->{"Select_scan"},$mystat2->{"Slow_queries"},$mystat2->{"Com_commit"},$mystat2->{"Com_rollback"},$mystat2->{"Open_files"},$mystat2->{"Open_table_definitions"},$mystat2->{"Open_tables"},$mystat2->{"Opened_files"},$mystat2->{"Opened_table_definitions"},$mystat2->{"Opened_tables"},$mystat2->{"Created_tmp_disk_tables"},$mystat2->{"Created_tmp_files"},$mystat2->{"Created_tmp_tables"},$mystat2->{"Binlog_cache_disk_use"},$mystat2->{"Binlog_cache_use"},$mystat2->{"Aborted_clients"},$mystat2->{"Sort_merge_passes"},$mystat2->{"Sort_range"},$mystat2->{"Sort_rows"},$mystat2->{"Sort_scan"},$mystat2->{"Table_locks_immediate"},$mystat2->{"Table_locks_waited"},$mystat2->{"Handler_read_first"},$mystat2->{"Handler_read_key"},$mystat2->{"Handler_read_last"},$mystat2->{"Handler_read_next"},$mystat2->{"Handler_read_prev"},$mystat2->{"Handler_read_rnd"},$mystat2->{"Handler_read_rnd_next"}, \"$snap_time\")};
0 commit comments