This plugin provides native MySQL instrumentation for monitoring and metrics collection, including: service health, database connectivity, `InnoDB` locks, replication status, metrics collection, and sending metrics to a MySQL database.
[x] Update Changelog following the conventions laid out here
[x] Update README with any necessary configuration snippets
[ ] Binstubs are created if needed
[x] RuboCop passes
[x] Existing tests pass
New Plugins
[x] Tests
[x] Add the plugin to the README
[ ] Does it have a complete header as outlined here
Purpose
The script metrics-mysql-select-count is not efficient enough, if multiple count metrics requested, because the majority of the CPU load is the starting of the script. The new metrics-mysql-multiple-select-count is implemented to solve this problem. Unlimited number of SQL count queries can be defined as a JSON string.
Known Compatibility Issues
Manual test
$ mysql -uroot -p**** test -e 'SELECT COUNT(*) FROM foo;SELECT COUNT(*) FROM bar;'
mysql: [Warning] Using a password on the command line interface can be insecure.
+----------+
| COUNT(*) |
+----------+
| 114059 |
+----------+
+----------+
| COUNT(*) |
+----------+
| 90941 |
+----------+
$ bin/metrics-mysql-multiple-select-count.rb -d test -h localhost -S /var/run/mysqld/mysqld.sock -u root -p**** -q '{"foo_count":"SELECT COUNT(*) FROM foo", "bar_count":"SELECT COUNT(*) FROM bar"}'
mysql.query_count.foo_count 114059 1544534615
mysql.query_count.bar_count 90941 1544534615
Pull Request Checklist
Is this in reference to an existing issue?
No
General
[x] Update Changelog following the conventions laid out here
[x] Update README with any necessary configuration snippets
[ ] Binstubs are created if needed
[x] RuboCop passes
[x] Existing tests pass
New Plugins
[x] Tests
[x] Add the plugin to the README
[ ] Does it have a complete header as outlined here
Purpose
The script metrics-mysql-select-count is not efficient enough, if multiple count metrics requested, because the majority of the CPU load is the starting of the script. The new metrics-mysql-multiple-select-count is implemented to solve this problem. Unlimited number of SQL count queries can be defined as a JSON string.
Known Compatibility Issues
Manual test