+ else if (db->innodb_stats && strncmp (key, "Innodb_", strlen ("Innodb_")) == 0)
+ {
+ /* buffer pool */
+ if (strcmp (key, "Innodb_buffer_pool_pages_data") == 0)
+ gauge_submit ("mysql_bpool_pages", "data", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_pages_dirty") == 0)
+ gauge_submit ("mysql_bpool_pages", "dirty", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_pages_flushed") == 0)
+ derive_submit ("mysql_bpool_counters", "pages_flushed", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_pages_free") == 0)
+ gauge_submit ("mysql_bpool_pages", "free", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_pages_misc") == 0)
+ gauge_submit ("mysql_bpool_pages", "misc", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_pages_total") == 0)
+ gauge_submit ("mysql_bpool_pages", "total", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_read_ahead_rnd") == 0)
+ derive_submit ("mysql_bpool_counters", "read_ahead_rnd", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_read_ahead") == 0)
+ derive_submit ("mysql_bpool_counters", "read_ahead", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_read_ahead_evicted") == 0)
+ derive_submit ("mysql_bpool_counters", "read_ahead_evicted", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_read_requests") == 0)
+ derive_submit ("mysql_bpool_counters", "read_requests", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_reads") == 0)
+ derive_submit ("mysql_bpool_counters", "reads", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_wait_free") == 0)
+ derive_submit ("mysql_bpool_counters", "wait_free", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_write_requests") == 0)
+ derive_submit ("mysql_bpool_counters", "write_requests", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_bytes_data") == 0)
+ gauge_submit ("mysql_bpool_bytes", "data", val, db);
+ else if (strcmp (key, "Innodb_buffer_pool_bytes_dirty") == 0)
+ gauge_submit ("mysql_bpool_bytes", "dirty", val, db);
+
+ /* data */
+ if (strcmp (key, "Innodb_data_fsyncs") == 0)
+ derive_submit ("mysql_innodb_data", "fsyncs", val, db);
+ else if (strcmp (key, "Innodb_data_read") == 0)
+ derive_submit ("mysql_innodb_data", "read", val, db);
+ else if (strcmp (key, "Innodb_data_reads") == 0)
+ derive_submit ("mysql_innodb_data", "reads", val, db);
+ else if (strcmp (key, "Innodb_data_writes") == 0)
+ derive_submit ("mysql_innodb_data", "writes", val, db);
+ else if (strcmp (key, "Innodb_data_written") == 0)
+ derive_submit ("mysql_innodb_data", "written", val, db);
+
+ /* double write */
+ else if (strcmp (key, "Innodb_dblwr_writes") == 0)
+ derive_submit ("mysql_innodb_dblwr", "writes", val, db);
+ else if (strcmp (key, "Innodb_dblwr_pages_written") == 0)
+ derive_submit ("mysql_innodb_dblwr", "written", val, db);
+ else if (strcmp (key, "Innodb_dblwr_page_size") == 0)
+ gauge_submit ("mysql_innodb_dblwr", "page_size", val, db);
+
+ /* log */
+ else if (strcmp (key, "Innodb_log_waits") == 0)
+ derive_submit ("mysql_innodb_log", "waits", val, db);
+ else if (strcmp (key, "Innodb_log_write_requests") == 0)
+ derive_submit ("mysql_innodb_log", "write_requests", val, db);
+ else if (strcmp (key, "Innodb_log_writes") == 0)
+ derive_submit ("mysql_innodb_log", "writes", val, db);
+ else if (strcmp (key, "Innodb_os_log_fsyncs") == 0)
+ derive_submit ("mysql_innodb_log", "fsyncs", val, db);
+ else if (strcmp (key, "Innodb_os_log_written") == 0)
+ derive_submit ("mysql_innodb_log", "written", val, db);
+
+ /* pages */
+ else if (strcmp (key, "Innodb_pages_created") == 0)
+ derive_submit ("mysql_innodb_pages", "created", val, db);
+ else if (strcmp (key, "Innodb_pages_read") == 0)
+ derive_submit ("mysql_innodb_pages", "read", val, db);
+ else if (strcmp (key, "Innodb_pages_written") == 0)
+ derive_submit ("mysql_innodb_pages", "written", val, db);
+
+ /* row lock */
+ else if (strcmp (key, "Innodb_row_lock_time") == 0)
+ derive_submit ("mysql_innodb_row_lock", "time", val, db);
+ else if (strcmp (key, "Innodb_row_lock_waits") == 0)
+ derive_submit ("mysql_innodb_row_lock", "waits", val, db);
+
+ /* rows */
+ else if (strcmp (key, "Innodb_rows_deleted") == 0)
+ derive_submit ("mysql_innodb_rows", "deleted", val, db);
+ else if (strcmp (key, "Innodb_rows_inserted") == 0)
+ derive_submit ("mysql_innodb_rows", "inserted", val, db);
+ else if (strcmp (key, "Innodb_rows_read") == 0)
+ derive_submit ("mysql_innodb_rows", "read", val, db);
+ else if (strcmp (key, "Innodb_rows_updated") == 0)
+ derive_submit ("mysql_innodb_rows", "updated", val, db);
+ }
+ else if (strncmp (key, "Select_", strlen ("Select_")) == 0)
+ {
+ derive_submit ("mysql_select", key + strlen ("Select_"),
+ val, db);
+ }
+ else if (strncmp (key, "Sort_", strlen ("Sort_")) == 0)
+ {
+ if (strcmp (key, "Sort_merge_passes") == 0)
+ derive_submit ("mysql_sort_merge_passes", NULL, val, db);
+ else if (strcmp (key, "Sort_rows") == 0)
+ derive_submit ("mysql_sort_rows", NULL, val, db);
+ else if (strcmp (key, "Sort_range") == 0)
+ derive_submit ("mysql_sort", "range", val, db);
+ else if (strcmp (key, "Sort_scan") == 0)
+ derive_submit ("mysql_sort", "scan", val, db);
+
+ }
+ else if (strncmp (key, "Slow_queries", strlen ("Slow_queries")) == 0)
+ {
+ derive_submit ("mysql_slow_queries", NULL , val, db);
+ }