From: Costa Tsaousis (ktsaou) Date: Fri, 20 Nov 2015 23:29:25 +0000 (+0200) Subject: more mysql charts X-Git-Tag: v1.0rc~258 X-Git-Url: https://arthur.barton.de/gitweb/?p=netdata.git;a=commitdiff_plain;h=ce954f71ffa7859f14d7d4926147eef264d4b7da more mysql charts --- diff --git a/charts.d/mysql.chart.sh b/charts.d/mysql.chart.sh index b9bb9377..48433ca1 100755 --- a/charts.d/mysql.chart.sh +++ b/charts.d/mysql.chart.sh @@ -83,9 +83,7 @@ DIMENSION Queries queries incremental 1 $((1 * mysql_update_every)) DIMENSION Questions questions incremental 1 $((1 * mysql_update_every)) DIMENSION Slow_queries slow_queries incremental -1 $((1 * mysql_update_every)) -CHART mysql_$m.operations '' "mysql Operations" "operations / sec" mysql_$m mysql line 20003 $mysql_update_every -DIMENSION Opened_tables opened_tables incremental 1 $((1 * mysql_update_every)) -DIMENSION Flush_commands flush incremental 1 $((1 * mysql_update_every)) +CHART mysql_$m.handlers '' "mysql Handlers" "handlers / sec" mysql_$m mysql line 20003 $mysql_update_every DIMENSION Handler_commit commit incremental 1 $((1 * mysql_update_every)) DIMENSION Handler_delete delete incremental 1 $((1 * mysql_update_every)) DIMENSION Handler_prepare prepare incremental 1 $((1 * mysql_update_every)) @@ -105,7 +103,7 @@ CHART mysql_$m.table_locks '' "mysql Tables Locks" "locks / sec" mysql_$m mysql DIMENSION Table_locks_immediate immediate incremental 1 $((1 * mysql_update_every)) DIMENSION Table_locks_waited waited incremental -1 $((1 * mysql_update_every)) -CHART mysql_$m.select_issues '' "mysql Select Issues" "issues / sec" mysql_$m mysql line 20005 $mysql_update_every +CHART mysql_$m.join_issues '' "mysql Select Join Issues" "joins / sec" mysql_$m mysql line 20005 $mysql_update_every DIMENSION Select_full_join full_join incremental 1 $((1 * mysql_update_every)) DIMENSION Select_full_range_join full_range_join incremental 1 $((1 * mysql_update_every)) DIMENSION Select_range range incremental 1 $((1 * mysql_update_every)) @@ -116,6 +114,71 @@ CHART mysql_$m.sort_issues '' "mysql Sort Issues" "issues / sec" mysql_$m mysql DIMENSION Sort_merge_passes merge_passes incremental 1 $((1 * mysql_update_every)) DIMENSION Sort_range range incremental 1 $((1 * mysql_update_every)) DIMENSION Sort_scan scan incremental 1 $((1 * mysql_update_every)) + +CHART mysql_$m.tmp '' "mysql Tmp Operations" "counter" mysql_$m mysql line 20007 $mysql_update_every +DIMENSION Created_tmp_disk_tables disk_tables incremental 1 $((1 * mysql_update_every)) +DIMENSION Created_tmp_files files incremental 1 $((1 * mysql_update_every)) +DIMENSION Created_tmp_tables tables incremental 1 $((1 * mysql_update_every)) + +CHART mysql_$m.connection_errors '' "mysql Connection Errors" "connections/s" mysql_$m mysql line 20008 $mysql_update_every +DIMENSION Connection_errors_accept accept incremental 1 $((1 * mysql_update_every)) +DIMENSION Connection_errors_internal internal incremental 1 $((1 * mysql_update_every)) +DIMENSION Connection_errors_max_connections max incremental 1 $((1 * mysql_update_every)) +DIMENSION Connection_errors_peer_addr peer_addr incremental 1 $((1 * mysql_update_every)) +DIMENSION Connection_errors_select select incremental 1 $((1 * mysql_update_every)) +DIMENSION Connection_errors_tcpwrap tcpwrap incremental 1 $((1 * mysql_update_every)) + +CHART mysql_$m.connections '' "mysql Connections" "connections/s" mysql_$m mysql line 20009 $mysql_update_every +DIMENSION Connections all incremental 1 $((1 * mysql_update_every)) +DIMENSION Aborted_connects aborded incremental 1 $((1 * mysql_update_every)) + +CHART mysql_$m.binlog_cache '' "mysql Binlog Cache" "transactions/s" mysql_$m mysql line 20010 $mysql_update_every +DIMENSION Binlog_cache_disk_use disk incremental 1 $((1 * mysql_update_every)) +DIMENSION Binlog_cache_use all incremental 1 $((1 * mysql_update_every)) + +CHART mysql_$m.binlog_stmt_cache '' "mysql Binlog Statement Cache" "statements/s" mysql_$m mysql line 20011 $mysql_update_every +DIMENSION Binlog_stmt_cache_disk_use disk incremental 1 $((1 * mysql_update_every)) +DIMENSION Binlog_stmt_cache_use all incremental 1 $((1 * mysql_update_every)) + +CHART mysql_$m.threads '' "mysql Threads" "threads" mysql_$m mysql line 20012 $mysql_update_every +DIMENSION Threads_connected connected absolute 1 $((1 * mysql_update_every)) +DIMENSION Threads_created created incremental 1 $((1 * mysql_update_every)) +DIMENSION Threads_cached cached absolute -1 $((1 * mysql_update_every)) +DIMENSION Threads_running running absolute 1 $((1 * mysql_update_every)) + +CHART mysql_$m.thread_cache_misses '' "mysql Threads Cache Misses" "misses" mysql_$m mysql area 20013 $mysql_update_every +DIMENSION misses misses absolute 1 $((100 * mysql_update_every)) + +CHART mysql_$m.innodb_io '' "mysql InnoDB I/O Bandwidth" "kbps" mysql_$m mysql area 20014 $mysql_update_every +DIMENSION Innodb_data_read read incremental 8 $((1000 * mysql_update_every)) +DIMENSION Innodb_data_written write incremental -8 $((1000 * mysql_update_every)) + +CHART mysql_$m.innodb_io_ops '' "mysql InnoDB I/O Operations" "operations/s" mysql_$m mysql line 20015 $mysql_update_every +DIMENSION Innodb_data_reads reads incremental 1 $((1 * mysql_update_every)) +DIMENSION Innodb_data_writes writes incremental -1 $((1 * mysql_update_every)) + +CHART mysql_$m.innodb_log '' "mysql InnoDB Log Operations" "operations/s" mysql_$m mysql line 20016 $mysql_update_every +DIMENSION Innodb_log_waits waits incremental 1 $((1 * mysql_update_every)) +DIMENSION Innodb_log_write_requests write_requests incremental -1 $((1 * mysql_update_every)) +DIMENSION Innodb_log_writes writes incremental -1 $((1 * mysql_update_every)) + +CHART mysql_$m.innodb_os_log '' "mysql InnoDB OS Log Operations" "operations/s" mysql_$m mysql line 20017 $mysql_update_every +DIMENSION Innodb_os_log_fsyncs fsyncs incremental 1 $((1 * mysql_update_every)) +DIMENSION Innodb_os_log_pending_fsyncs pending_fsyncs incremental 1 $((1 * mysql_update_every)) +DIMENSION Innodb_os_log_pending_writes pending_writes incremental -1 $((1 * mysql_update_every)) + +CHART mysql_$m.innodb_os_log_io '' "mysql InnoDB OS Log Bandwidth" "kbps" mysql_$m mysql area 20018 $mysql_update_every +DIMENSION Innodb_os_log_written write incremental -8 $((1000 * mysql_update_every)) + +CHART mysql_$m.innodb_cur_row_lock '' "mysql InnoDB Current Row Locks" "operations" mysql_$m mysql area 20019 $mysql_update_every +DIMENSION Innodb_row_lock_current_waits current_waits absolute 1 $((1 * mysql_update_every)) + +CHART mysql_$m.innodb_rows '' "mysql InnoDB Row Operations" "operations/s" mysql_$m mysql area 20020 $mysql_update_every +DIMENSION Innodb_rows_read read incremental 1 $((1 * mysql_update_every)) +DIMENSION Innodb_rows_deleted deleted incremental -1 $((1 * mysql_update_every)) +DIMENSION Innodb_rows_inserted inserted incremental 1 $((1 * mysql_update_every)) +DIMENSION Innodb_rows_updated updated incremental -1 $((1 * mysql_update_every)) + EOF done return 0 @@ -145,7 +208,75 @@ mysql_update() { for m in "${!mysql_ids[@]}" do x="${mysql_ids[$m]}" + + unset \ + mysql_Bytes_received \ + mysql_Bytes_sent \ + mysql_Queries \ + mysql_Questions \ + mysql_Slow_queries \ + mysql_Handler_commit \ + mysql_Handler_delete \ + mysql_Handler_prepare \ + mysql_Handler_read_first \ + mysql_Handler_read_key \ + mysql_Handler_read_next \ + mysql_Handler_read_prev \ + mysql_Handler_read_rnd \ + mysql_Handler_read_rnd_next \ + mysql_Handler_rollback \ + mysql_Handler_savepoint \ + mysql_Handler_savepoint_rollback \ + mysql_Handler_update \ + mysql_Handler_write \ + mysql_Table_locks_immediate \ + mysql_Table_locks_waited \ + mysql_Select_full_join \ + mysql_Select_full_range_join \ + mysql_Select_range \ + mysql_Select_range_check \ + mysql_Select_scan \ + mysql_Sort_merge_passes \ + mysql_Sort_range \ + mysql_Sort_scan \ + mysql_Created_tmp_disk_tables \ + mysql_Created_tmp_files \ + mysql_Created_tmp_tables \ + mysql_Connection_errors_accept \ + mysql_Connection_errors_internal \ + mysql_Connection_errors_max_connections \ + mysql_Connection_errors_peer_addr \ + mysql_Connection_errors_select \ + mysql_Connection_errors_tcpwrap \ + mysql_Connections \ + mysql_Aborted_connects \ + mysql_Binlog_cache_disk_use \ + mysql_Binlog_cache_use \ + mysql_Binlog_stmt_cache_disk_use \ + mysql_Binlog_stmt_cache_use \ + mysql_Threads_connected \ + mysql_Threads_created \ + mysql_Threads_cached \ + mysql_Threads_running \ + mysql_Innodb_data_read \ + mysql_Innodb_data_written \ + mysql_Innodb_data_reads \ + mysql_Innodb_data_writes \ + mysql_Innodb_log_waits \ + mysql_Innodb_log_write_requests \ + mysql_Innodb_log_writes \ + mysql_Innodb_os_log_fsyncs \ + mysql_Innodb_os_log_pending_fsyncs \ + mysql_Innodb_os_log_pending_writes \ + mysql_Innodb_os_log_written \ + mysql_Innodb_row_lock_current_waits \ + mysql_Innodb_rows_inserted \ + mysql_Innodb_rows_read \ + mysql_Innodb_rows_updated \ + mysql_Innodb_rows_deleted + mysql_plugin_command_failure=0 + eval "$(mysql_get "${mysql_cmds[$m]}" ${mysql_opts[$m]} |\ sed -e "s/[[:space:]]\+/ /g" -e "s/\./_/g" -e "s/^\([a-zA-Z0-9_]\+\)[[:space:]]\+\([0-9]\+\)$/local mysql_\1=\2/g" |\ egrep "^local mysql_[a-zA-Z0-9_]+=[[:digit:]]+$")" @@ -159,8 +290,12 @@ mysql_update() { continue fi - # write the result of the work. - cat <