I've been using the MonAMI MySQL metrics collection plugin with some
minor modifications to collect metrics from MySQL database
servers. The plugin collects metrics using "SHOW GLOBAL STATUS"
and using the INFORMATION_SCHEMA. The MySQL plugin can be used to
write the metrics into a MySQL database. My plugin configuration
results is a table like the following:
CREATE TABLE metrics collected TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, hostname VARCHAR(50), questions BIGINT, com_select BIGINT, com_insert BIGINT, ... primary key(collected,hostname), key(hostname) ) ENGINE=INNODB;
The MySQL plugin records the values exactly as collected from the
database server. This might seem unimportant, but consider the
fact that we are most interested in calculating "per second" type
statistics for our servers. In the table, `com_select` increases
in …