- if (strncmp (key, "Com_insert", 10) == 0)
- cmd_insert += val;
- else if (strncmp (key, "Com_select", 10) == 0)
- cmd_select += val;
- else if (strncmp (key, "Com_show", 8) == 0)
- cmd_show += val;
- else if (strncmp (key, "Com_update", 10) == 0)
- cmd_update += val;
- else if (strncmp (key, "Com_stmt_", 9) == 0)
- { /* do nothing */ }
- else
- cmd_other += val;
+ if (val == 0ULL)
+ continue;
+
+ /* Ignore `prepared statements' */
+ if (strncmp (key, "Com_stmt_", 9) != 0)
+ counter_submit ("mysql_commands", key + 4, val);
+ }
+ else if (strncmp (key, "Handler_", 8) == 0)
+ {
+ if (val == 0ULL)
+ continue;
+
+ counter_submit ("mysql_handler", key + 8, val);
+ }
+ else if (strncmp (key, "Qcache_", 7) == 0)
+ {
+ if (strcmp (key, "Qcache_hits") == 0)
+ qcache_hits = val;
+ else if (strcmp (key, "Qcache_inserts") == 0)
+ qcache_inserts = val;
+ else if (strcmp (key, "Qcache_not_cached") == 0)
+ qcache_not_cached = val;
+ else if (strcmp (key, "Qcache_lowmem_prunes") == 0)
+ qcache_lowmem_prunes = val;
+ else if (strcmp (key, "Qcache_queries_in_cache") == 0)
+ qcache_queries_in_cache = (int) val;