summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 298e7bf)
raw | patch | inline | side by side (parent: 298e7bf)
author | Doug MacEachern <dougm@hyperic.com> | |
Thu, 8 Jan 2009 01:58:49 +0000 (17:58 -0800) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Tue, 20 Jan 2009 09:32:51 +0000 (10:32 +0100) |
Signed-off-by: Doug MacEachern <dougm@hyperic.com>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/memcached.c | patch | blob | history |
diff --git a/src/memcached.c b/src/memcached.c
index 7bdad0a01a475f42d7d5c9c37b07c1abf62a0144..fb33880ff5cc68aae4764723742e4cc3e0944f99 100644 (file)
--- a/src/memcached.c
+++ b/src/memcached.c
gauge_t bytes_used = NAN;
gauge_t bytes_total = NAN;
+ gauge_t hits = NAN;
+ gauge_t gets = NAN;
counter_t rusage_user = 0;
counter_t rusage_syst = 0;
counter_t octets_rx = 0;
{
const char *name = fields[1] + 4;
submit_counter ("memcached_command", name, atoll (fields[2]));
+ if (strcmp (name, "get") == 0)
+ gets = atof (fields[2]);
}
/*
else if (FIELD_IS ("get_hits"))
{
submit_counter ("memcached_ops", "hits", atoll (fields[2]));
+ hits = atof (fields[2]);
}
else if (FIELD_IS ("get_misses"))
{
if ((octets_rx != 0) || (octets_tx != 0))
submit_counter2 ("memcached_octets", NULL, octets_rx, octets_tx);
+ if (! isnan (gets) && !isnan (hits))
+ submit_gauge ("percent", "hitratio", (hits / gets) * 100.0);
return 0;
}
/* }}} */