-static void qcache_submit (unsigned long long hits, unsigned long long inserts,
- unsigned long long not_cached, unsigned long long lowmem_prunes,
- int queries_in_cache)
-{
- char buf[BUFSIZE];
- int status;
-
- status = snprintf (buf, BUFSIZE, "%u:%llu:%llu:%llu:%llu:%i",
- (unsigned int) curtime, hits, inserts, not_cached,
- lowmem_prunes, queries_in_cache);
-
- if (status < 0)
- {
- syslog (LOG_ERR, "snprintf failed");
- return;
- }
- else if (status >= BUFSIZE)
- {
- syslog (LOG_WARNING, "snprintf was truncated");
- return;
- }
-
- plugin_submit ("mysql_qcache", "-", buf);
-}
-
-static void threads_submit (int running, int connected, int cached,
- unsigned long long created)
-{
- char buf[BUFSIZE];
- int status;
-
- status = snprintf (buf, BUFSIZE, "%u:%i:%i:%i:%llu",
- (unsigned int) curtime,
- running, connected, cached, created);
-
- if (status < 0)
- {
- syslog (LOG_ERR, "snprintf failed");
- return;
- }
- else if (status >= BUFSIZE)
- {
- syslog (LOG_WARNING, "snprintf was truncated");
- return;
- }
-
- plugin_submit ("mysql_threads", "-", buf);
-}
-
-static void traffic_submit (unsigned long long incoming,
- unsigned long long outgoing)
-{
- char buf[BUFSIZE];
- int status;
-
- status = snprintf (buf, BUFSIZE, "%u:%llu:%llu", (unsigned int) curtime,
- incoming, outgoing);
-
- if (status < 0)
- {
- syslog (LOG_ERR, "snprintf failed");
- return;
- }
- else if (status >= BUFSIZE)
- {
- syslog (LOG_WARNING, "snprintf was truncated");
- return;
- }
-
- plugin_submit ("mysql_traffic", "-", buf);
-}
-
-static void mysql_read (void)