- rrd_update_file (host, threads_file, val,
- threads_ds_def, threads_ds_num);
-}
-
-static void traffic_write (char *host, char *inst, char *val)
-{
- rrd_update_file (host, traffic_file, val,
- traffic_ds_def, traffic_ds_num);
-}
-
-#if MYSQL_HAVE_READ
-static void commands_submit (char *inst, unsigned long long value)
-{
- char buf[BUFSIZE];
- int status;
-
- status = snprintf (buf, BUFSIZE, "%u:%llu", (unsigned int) curtime, value);
-
- if (status < 0)
- {
- syslog (LOG_ERR, "snprintf failed");
- return;
- }
- else if (status >= BUFSIZE)
- {
- syslog (LOG_WARNING, "snprintf was truncated");
- return;
- }
-
- plugin_submit ("mysql_commands", inst, buf);
-}
-
-static void handler_submit (char *inst, unsigned long long value)
-{
- char buf[BUFSIZE];
- int status;
-
- status = snprintf (buf, BUFSIZE, "%u:%llu", (unsigned int) curtime, value);
-
- if (status < 0)
- {
- syslog (LOG_ERR, "snprintf failed");
- return;
- }
- else if (status >= BUFSIZE)
- {
- syslog (LOG_WARNING, "snprintf was truncated");
- return;
- }
-
- plugin_submit ("mysql_handler", inst, buf);
-}
-
-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;
- }