more mysql charts
Costa Tsaousis (ktsaou) committed
Nov 21, 2015 at 01:29 UTC
ce954f71ffa7859f14d7d4926147eef264d4b7da
1 file changed
+207
-10
charts.d/mysql.chart.sh
+207
-10
@@ -83,9 +83,7 @@ DIMENSION Queries queries incremental 1 $((1 * mysql_update_every))
83
DIMENSION Questions questions incremental 1 $((1 * mysql_update_every))
84
DIMENSION Slow_queries slow_queries incremental -1 $((1 * mysql_update_every))
85
86
-CHART mysql_$m.operations '' "mysql Operations" "operations / sec" mysql_$m mysql line 20003 $mysql_update_every
87
-DIMENSION Opened_tables opened_tables incremental 1 $((1 * mysql_update_every))
88
-DIMENSION Flush_commands flush incremental 1 $((1 * mysql_update_every))
86
+CHART mysql_$m.handlers '' "mysql Handlers" "handlers / sec" mysql_$m mysql line 20003 $mysql_update_every
87
DIMENSION Handler_commit commit incremental 1 $((1 * mysql_update_every))
88
DIMENSION Handler_delete delete incremental 1 $((1 * mysql_update_every))
89
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
103
DIMENSION Table_locks_immediate immediate incremental 1 $((1 * mysql_update_every))
104
DIMENSION Table_locks_waited waited incremental -1 $((1 * mysql_update_every))
105
108
-CHART mysql_$m.select_issues '' "mysql Select Issues" "issues / sec" mysql_$m mysql line 20005 $mysql_update_every
106
+CHART mysql_$m.join_issues '' "mysql Select Join Issues" "joins / sec" mysql_$m mysql line 20005 $mysql_update_every
107
DIMENSION Select_full_join full_join incremental 1 $((1 * mysql_update_every))
108
DIMENSION Select_full_range_join full_range_join incremental 1 $((1 * mysql_update_every))
109
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
114
DIMENSION Sort_merge_passes merge_passes incremental 1 $((1 * mysql_update_every))
115
DIMENSION Sort_range range incremental 1 $((1 * mysql_update_every))
116
DIMENSION Sort_scan scan incremental 1 $((1 * mysql_update_every))
117
+
118
+CHART mysql_$m.tmp '' "mysql Tmp Operations" "counter" mysql_$m mysql line 20007 $mysql_update_every
119
+DIMENSION Created_tmp_disk_tables disk_tables incremental 1 $((1 * mysql_update_every))
120
+DIMENSION Created_tmp_files files incremental 1 $((1 * mysql_update_every))
121
+DIMENSION Created_tmp_tables tables incremental 1 $((1 * mysql_update_every))
122
+
123
+CHART mysql_$m.connection_errors '' "mysql Connection Errors" "connections/s" mysql_$m mysql line 20008 $mysql_update_every
124
+DIMENSION Connection_errors_accept accept incremental 1 $((1 * mysql_update_every))
125
+DIMENSION Connection_errors_internal internal incremental 1 $((1 * mysql_update_every))
126
+DIMENSION Connection_errors_max_connections max incremental 1 $((1 * mysql_update_every))
127
+DIMENSION Connection_errors_peer_addr peer_addr incremental 1 $((1 * mysql_update_every))
128
+DIMENSION Connection_errors_select select incremental 1 $((1 * mysql_update_every))
129
+DIMENSION Connection_errors_tcpwrap tcpwrap incremental 1 $((1 * mysql_update_every))
130
+
131
+CHART mysql_$m.connections '' "mysql Connections" "connections/s" mysql_$m mysql line 20009 $mysql_update_every
132
+DIMENSION Connections all incremental 1 $((1 * mysql_update_every))
133
+DIMENSION Aborted_connects aborded incremental 1 $((1 * mysql_update_every))
134
+
135
+CHART mysql_$m.binlog_cache '' "mysql Binlog Cache" "transactions/s" mysql_$m mysql line 20010 $mysql_update_every
136
+DIMENSION Binlog_cache_disk_use disk incremental 1 $((1 * mysql_update_every))
137
+DIMENSION Binlog_cache_use all incremental 1 $((1 * mysql_update_every))
138
+
139
+CHART mysql_$m.binlog_stmt_cache '' "mysql Binlog Statement Cache" "statements/s" mysql_$m mysql line 20011 $mysql_update_every
140
+DIMENSION Binlog_stmt_cache_disk_use disk incremental 1 $((1 * mysql_update_every))
141
+DIMENSION Binlog_stmt_cache_use all incremental 1 $((1 * mysql_update_every))
142
+
143
+CHART mysql_$m.threads '' "mysql Threads" "threads" mysql_$m mysql line 20012 $mysql_update_every
144
+DIMENSION Threads_connected connected absolute 1 $((1 * mysql_update_every))
145
+DIMENSION Threads_created created incremental 1 $((1 * mysql_update_every))
146
+DIMENSION Threads_cached cached absolute -1 $((1 * mysql_update_every))
147
+DIMENSION Threads_running running absolute 1 $((1 * mysql_update_every))
148
+
149
+CHART mysql_$m.thread_cache_misses '' "mysql Threads Cache Misses" "misses" mysql_$m mysql area 20013 $mysql_update_every
150
+DIMENSION misses misses absolute 1 $((100 * mysql_update_every))
151
+
152
+CHART mysql_$m.innodb_io '' "mysql InnoDB I/O Bandwidth" "kbps" mysql_$m mysql area 20014 $mysql_update_every
153
+DIMENSION Innodb_data_read read incremental 8 $((1000 * mysql_update_every))
154
+DIMENSION Innodb_data_written write incremental -8 $((1000 * mysql_update_every))
155
+
156
+CHART mysql_$m.innodb_io_ops '' "mysql InnoDB I/O Operations" "operations/s" mysql_$m mysql line 20015 $mysql_update_every
157
+DIMENSION Innodb_data_reads reads incremental 1 $((1 * mysql_update_every))
158
+DIMENSION Innodb_data_writes writes incremental -1 $((1 * mysql_update_every))
159
+
160
+CHART mysql_$m.innodb_log '' "mysql InnoDB Log Operations" "operations/s" mysql_$m mysql line 20016 $mysql_update_every
161
+DIMENSION Innodb_log_waits waits incremental 1 $((1 * mysql_update_every))
162
+DIMENSION Innodb_log_write_requests write_requests incremental -1 $((1 * mysql_update_every))
163
+DIMENSION Innodb_log_writes writes incremental -1 $((1 * mysql_update_every))
164
+
165
+CHART mysql_$m.innodb_os_log '' "mysql InnoDB OS Log Operations" "operations/s" mysql_$m mysql line 20017 $mysql_update_every
166
+DIMENSION Innodb_os_log_fsyncs fsyncs incremental 1 $((1 * mysql_update_every))
167
+DIMENSION Innodb_os_log_pending_fsyncs pending_fsyncs incremental 1 $((1 * mysql_update_every))
168
+DIMENSION Innodb_os_log_pending_writes pending_writes incremental -1 $((1 * mysql_update_every))
169
+
170
+CHART mysql_$m.innodb_os_log_io '' "mysql InnoDB OS Log Bandwidth" "kbps" mysql_$m mysql area 20018 $mysql_update_every
171
+DIMENSION Innodb_os_log_written write incremental -8 $((1000 * mysql_update_every))
172
+
173
+CHART mysql_$m.innodb_cur_row_lock '' "mysql InnoDB Current Row Locks" "operations" mysql_$m mysql area 20019 $mysql_update_every
174
+DIMENSION Innodb_row_lock_current_waits current_waits absolute 1 $((1 * mysql_update_every))
175
+
176
+CHART mysql_$m.innodb_rows '' "mysql InnoDB Row Operations" "operations/s" mysql_$m mysql area 20020 $mysql_update_every
177
+DIMENSION Innodb_rows_read read incremental 1 $((1 * mysql_update_every))
178
+DIMENSION Innodb_rows_deleted deleted incremental -1 $((1 * mysql_update_every))
179
+DIMENSION Innodb_rows_inserted inserted incremental 1 $((1 * mysql_update_every))
180
+DIMENSION Innodb_rows_updated updated incremental -1 $((1 * mysql_update_every))
181
+
182
EOF
183
done
184
return 0
@@ -145,7 +208,75 @@ mysql_update() {
208
for m in "${!mysql_ids[@]}"
209
do
210
x="${mysql_ids[$m]}"
211
+
212
+ unset \
213
+ mysql_Bytes_received \
214
+ mysql_Bytes_sent \
215
+ mysql_Queries \
216
+ mysql_Questions \
217
+ mysql_Slow_queries \
218
+ mysql_Handler_commit \
219
+ mysql_Handler_delete \
220
+ mysql_Handler_prepare \
221
+ mysql_Handler_read_first \
222
+ mysql_Handler_read_key \
223
+ mysql_Handler_read_next \
224
+ mysql_Handler_read_prev \
225
+ mysql_Handler_read_rnd \
226
+ mysql_Handler_read_rnd_next \
227
+ mysql_Handler_rollback \
228
+ mysql_Handler_savepoint \
229
+ mysql_Handler_savepoint_rollback \
230
+ mysql_Handler_update \
231
+ mysql_Handler_write \
232
+ mysql_Table_locks_immediate \
233
+ mysql_Table_locks_waited \
234
+ mysql_Select_full_join \
235
+ mysql_Select_full_range_join \
236
+ mysql_Select_range \
237
+ mysql_Select_range_check \
238
+ mysql_Select_scan \
239
+ mysql_Sort_merge_passes \
240
+ mysql_Sort_range \
241
+ mysql_Sort_scan \
242
+ mysql_Created_tmp_disk_tables \
243
+ mysql_Created_tmp_files \
244
+ mysql_Created_tmp_tables \
245
+ mysql_Connection_errors_accept \
246
+ mysql_Connection_errors_internal \
247
+ mysql_Connection_errors_max_connections \
248
+ mysql_Connection_errors_peer_addr \
249
+ mysql_Connection_errors_select \
250
+ mysql_Connection_errors_tcpwrap \
251
+ mysql_Connections \
252
+ mysql_Aborted_connects \
253
+ mysql_Binlog_cache_disk_use \
254
+ mysql_Binlog_cache_use \
255
+ mysql_Binlog_stmt_cache_disk_use \
256
+ mysql_Binlog_stmt_cache_use \
257
+ mysql_Threads_connected \
258
+ mysql_Threads_created \
259
+ mysql_Threads_cached \
260
+ mysql_Threads_running \
261
+ mysql_Innodb_data_read \
262
+ mysql_Innodb_data_written \
263
+ mysql_Innodb_data_reads \
264
+ mysql_Innodb_data_writes \
265
+ mysql_Innodb_log_waits \
266
+ mysql_Innodb_log_write_requests \
267
+ mysql_Innodb_log_writes \
268
+ mysql_Innodb_os_log_fsyncs \
269
+ mysql_Innodb_os_log_pending_fsyncs \
270
+ mysql_Innodb_os_log_pending_writes \
271
+ mysql_Innodb_os_log_written \
272
+ mysql_Innodb_row_lock_current_waits \
273
+ mysql_Innodb_rows_inserted \
274
+ mysql_Innodb_rows_read \
275
+ mysql_Innodb_rows_updated \
276
+ mysql_Innodb_rows_deleted
277
+
278
mysql_plugin_command_failure=0
279
+
280
eval "$(mysql_get "${mysql_cmds[$m]}" ${mysql_opts[$m]} |\
281
sed -e "s/[[:space:]]\+/ /g" -e "s/\./_/g" -e "s/^\([a-zA-Z0-9_]\+\)[[:space:]]\+\([0-9]\+\)$/local mysql_\1=\2/g" |\
282
egrep "^local mysql_[a-zA-Z0-9_]+=[[:digit:]]+$")"
@@ -159,8 +290,12 @@ mysql_update() {
290
continue
291
fi
292
162
- # write the result of the work.
163
- cat <<VALUESEOF
293
+ local misses=0
294
+ [ -z "$mysql_Connections" ] && mysql_Connections=0
295
+ [ $(( mysql_Connections + 1 - 1 )) -gt 0 ] && misses=$(( mysql_Threads_created * 10000 / mysql_Connections ))
296
+
297
+ # write the result of the work.
298
+ cat <<VALUESEOF
299
BEGIN mysql_$x.bandwidth $1
300
SET Bytes_received = $mysql_Bytes_received
301
SET Bytes_sent = $mysql_Bytes_sent
@@ -170,9 +305,7 @@ SET Queries = $mysql_Queries
305
SET Questions = $mysql_Questions
306
SET Slow_queries = $mysql_Slow_queries
307
END
173
-BEGIN mysql_$x.operations $1
174
-SET Opened_tables = $mysql_Opened_tables
175
-SET Flush_commands = $mysql_Flush_commands
308
+BEGIN mysql_$x.handlers $1
309
SET Handler_commit = $mysql_Handler_commit
310
SET Handler_delete = $mysql_Handler_delete
311
SET Handler_prepare = $mysql_Handler_prepare
@@ -192,7 +325,7 @@ BEGIN mysql_$x.table_locks $1
325
SET Table_locks_immediate = $mysql_Table_locks_immediate
326
SET Table_locks_waited = $mysql_Table_locks_waited
327
END
195
-BEGIN mysql_$x.select_issues $1
328
+BEGIN mysql_$x.join_issues $1
329
SET Select_full_join = $mysql_Select_full_join
330
SET Select_full_range_join = $mysql_Select_full_range_join
331
SET Select_range = $mysql_Select_range
@@ -204,6 +337,70 @@ SET Sort_merge_passes = $mysql_Sort_merge_passes
337
SET Sort_range = $mysql_Sort_range
338
SET Sort_scan = $mysql_Sort_scan
339
END
340
+BEGIN mysql_$m.tmp $1
341
+SET Created_tmp_disk_tables = $mysql_Created_tmp_disk_tables
342
+SET Created_tmp_files = $mysql_Created_tmp_files
343
+SET Created_tmp_tables = $mysql_Created_tmp_tables
344
+END
345
+BEGIN mysql_$m.connection_errors $1
346
+SET Connection_errors_accept = $mysql_Connection_errors_accept
347
+SET Connection_errors_internal = $mysql_Connection_errors_internal
348
+SET Connection_errors_max_connections = $mysql_Connection_errors_max_connections
349
+SET Connection_errors_peer_addr = $mysql_Connection_errors_peer_addr
350
+SET Connection_errors_select = $mysql_Connection_errors_select
351
+SET Connection_errors_tcpwrap = $mysql_Connection_errors_tcpwrap
352
+END
353
+BEGIN mysql_$m.connections $1
354
+SET Connections = $mysql_Connections
355
+SET Aborted_connects = $mysql_Aborted_connects
356
+END
357
+BEGIN mysql_$m.binlog_cache $1
358
+SET Binlog_cache_disk_use = $mysql_Binlog_cache_disk_use
359
+SET Binlog_cache_use = $mysql_Binlog_cache_use
360
+END
361
+BEGIN mysql_$m.binlog_stmt_cache $1
362
+SET Binlog_stmt_cache_disk_use = $mysql_Binlog_stmt_cache_disk_use
363
+SET Binlog_stmt_cache_use = $mysql_Binlog_stmt_cache_use
364
+END
365
+BEGIN mysql_$m.threads $1
366
+SET Threads_connected = $mysql_Threads_connected
367
+SET Threads_created = $mysql_Threads_created
368
+SET Threads_cached = $mysql_Threads_cached
369
+SET Threads_running = $mysql_Threads_running
370
+END
371
+BEGIN mysql_$m.thread_cache_misses $1
372
+SET misses = $misses
373
+END
374
+BEGIN mysql_$m.innodb_io $1
375
+SET Innodb_data_read = $mysql_Innodb_data_read
376
+SET Innodb_data_written = $mysql_Innodb_data_written
377
+END
378
+BEGIN mysql_$m.innodb_io_ops $1
379
+SET Innodb_data_reads = $mysql_Innodb_data_reads
380
+SET Innodb_data_writes = $mysql_Innodb_data_writes
381
+END
382
+BEGIN mysql_$m.innodb_log $1
383
+SET Innodb_log_waits = $mysql_Innodb_log_waits
384
+SET Innodb_log_write_requests = $mysql_Innodb_log_write_requests
385
+SET Innodb_log_writes = $mysql_Innodb_log_writes
386
+END
387
+BEGIN mysql_$m.innodb_os_log $1
388
+SET Innodb_os_log_fsyncs = $mysql_Innodb_os_log_fsyncs
389
+SET Innodb_os_log_pending_fsyncs = $mysql_Innodb_os_log_pending_fsyncs
390
+SET Innodb_os_log_pending_writes = $mysql_Innodb_os_log_pending_writes
391
+END
392
+BEGIN mysql_$m.innodb_os_log_io $1
393
+SET Innodb_os_log_written = $mysql_Innodb_os_log_written
394
+END
395
+BEGIN mysql_$m.innodb_cur_row_lock $1
396
+SET Innodb_row_lock_current_waits = $mysql_Innodb_row_lock_current_waits
397
+END
398
+BEGIN mysql_$m.innodb_rows $1
399
+SET Innodb_rows_inserted = $mysql_Innodb_rows_inserted
400
+SET Innodb_rows_read = $mysql_Innodb_rows_read
401
+SET Innodb_rows_updated = $mysql_Innodb_rows_updated
402
+SET Innodb_rows_deleted = $mysql_Innodb_rows_deleted
403
+END
404
VALUESEOF
405
done
406