Skip to content

Commit c5ea7f4

Browse files
committed
collect all handler status values
1 parent 4f58b61 commit c5ea7f4

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ You should then configure the MySQL plugin:
4141

4242
### MySQL Status
4343

44-
status.Com_*
44+
status.Com_*
45+
status.Handler_*
4546
status.Aborted_clients
4647
status.Aborted_connects
4748
status.Binlog_cache_disk_use

mysql.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,6 @@
4747
'Created_tmp_disk_tables': 'counter',
4848
'Created_tmp_files': 'counter',
4949
'Created_tmp_tables': 'counter',
50-
'Handler_commit': 'counter',
51-
'Handler_delete': 'counter',
52-
'Handler_discover': 'counter',
53-
'Handler_prepare': 'counter',
54-
'Handler_read_first': 'counter',
55-
'Handler_read_key': 'counter',
56-
'Handler_read_last': 'counter',
57-
'Handler_read_next': 'counter',
58-
'Handler_read_prev': 'counter',
59-
'Handler_read_rnd': 'counter',
60-
'Handler_read_rnd_next': 'counter',
61-
'Handler_rollback': 'counter',
62-
'Handler_savepoint': 'counter',
63-
'Handler_savepoint_rollback': 'counter',
64-
'Handler_update': 'counter',
65-
'Handler_write': 'counter',
6650
'Innodb_buffer_pool_pages_data': 'gauge',
6751
'Innodb_buffer_pool_pages_dirty': 'gauge',
6852
'Innodb_buffer_pool_pages_free': 'gauge',
@@ -500,9 +484,10 @@ def read_callback():
500484

501485
mysql_status = fetch_mysql_status(conn)
502486
for key in mysql_status:
503-
# collect anything beginning with Com_. these change regularly between
504-
# mysql versions and this is easier than a fixed list
505-
if key[:4] == 'Com_':
487+
# collect anything beginning with Com_/Handler_ as these change
488+
# regularly between mysql versions and this is easier than a fixed
489+
# list
490+
if key.split('_', 2)[0] in ['Com', 'Handler']:
506491
ds_type = 'counter'
507492
elif key in MYSQL_STATUS_VARS:
508493
ds_type = MYSQL_STATUS_VARS[key]

0 commit comments

Comments
 (0)