summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9ae3541)
raw | patch | inline | side by side (parent: 9ae3541)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 5 Jul 2010 08:27:46 +0000 (10:27 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 5 Jul 2010 08:27:46 +0000 (10:27 +0200) |
src/mysql.c | patch | blob | history |
diff --git a/src/mysql.c b/src/mysql.c
index 3fd73a247c90251ff721b0ff4a40234e655b9de2..48ad528b0f279b80f51df44cb64578d93ec0d7ea 100644 (file)
--- a/src/mysql.c
+++ b/src/mysql.c
submit (type, type_instance, values, STATIC_ARRAY_SIZE (values), db);
} /* void derive_submit */
-static void threads_submit (gauge_t running, gauge_t connected, gauge_t cached,
- counter_t created, mysql_database_t *db)
-{
- value_t values[4];
-
- values[0].gauge = running;
- values[1].gauge = connected;
- values[2].gauge = cached;
- values[3].counter = created;
-
- submit ("mysql_threads", NULL, values, STATIC_ARRAY_SIZE (values), db);
-} /* void threads_submit */
-
static void traffic_submit (counter_t rx, counter_t tx, mysql_database_t *db)
{
value_t values[2];
derive_t qcache_lowmem_prunes = 0;
gauge_t qcache_queries_in_cache = NAN;
- int threads_running = -1;
- int threads_connected = -1;
- int threads_cached = -1;
- unsigned long long threads_created = 0ULL;
+ gauge_t threads_running = NAN;
+ gauge_t threads_connected = NAN;
+ gauge_t threads_cached = NAN;
+ derive_t threads_created = 0;
unsigned long long traffic_incoming = 0ULL;
unsigned long long traffic_outgoing = 0ULL;
strlen ("Threads_")) == 0)
{
if (strcmp (key, "Threads_running") == 0)
- threads_running = (int) val;
+ threads_running = (gauge_t) val;
else if (strcmp (key, "Threads_connected") == 0)
- threads_connected = (int) val;
+ threads_connected = (gauge_t) val;
else if (strcmp (key, "Threads_cached") == 0)
- threads_cached = (int) val;
+ threads_cached = (gauge_t) val;
else if (strcmp (key, "Threads_created") == 0)
- threads_created = val;
+ threads_created = (derive_t) val;
}
else if (strncmp (key, "Table_locks_",
strlen ("Table_locks_")) == 0)
qcache_queries_in_cache, db);
}
- if (threads_created != 0ULL)
- threads_submit (threads_running, threads_connected,
- threads_cached, threads_created, db);
+ if (threads_created != 0)
+ {
+ gauge_submit ("threads", "running",
+ threads_running, db);
+ gauge_submit ("threads", "connected",
+ threads_connected, db);
+ gauge_submit ("threads", "cached",
+ threads_cached, db);
+
+ derive_submit ("total_threads", "created",
+ threads_created, db);
+ }
traffic_submit (traffic_incoming, traffic_outgoing, db);