summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 61b3f5e)
raw | patch | inline | side by side (parent: 61b3f5e)
author | Manuel Luis SanmartĂn Rozada <manuel.luis@gmail.com> | |
Wed, 5 Sep 2012 11:24:03 +0000 (13:24 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 2 Oct 2012 20:06:28 +0000 (22:06 +0200) |
Signed-off-by: Florian Forster <octo@collectd.org>
src/swap.c | patch | blob | history |
diff --git a/src/swap.c b/src/swap.c
index c7b634bc12d45de636d59a89850e0c8e6892e145..46d3534fcae818cd6fc286cd448d824ad22ccad8 100644 (file)
--- a/src/swap.c
+++ b/src/swap.c
swap_submit (plugin_instance, "swap", type_instance, v);
} /* }}} void swap_submit_gauge */
-#if KERNEL_LINUX
+#if KERNEL_LINUX || HAVE_PERFSTAT
static void swap_submit_derive (const char *plugin_instance, /* {{{ */
const char *type_instance, derive_t value)
{
v.derive = value;
swap_submit (plugin_instance, "swap_io", type_instance, v);
} /* }}} void swap_submit_derive */
+#endif
+#if KERNEL_LINUX
static int swap_read_separate (void) /* {{{ */
{
FILE *fh;
sstrerror (errno, errbuf, sizeof (errbuf)));
return (-1);
}
+
swap_submit_gauge (NULL, "used", (gauge_t) (pmemory.pgsp_total - pmemory.pgsp_free) * pagesize);
swap_submit_gauge (NULL, "free", (gauge_t) pmemory.pgsp_free * pagesize );
+ swap_submit_gauge (NULL, "reserved", (gauge_t) pmemory.pgsp_rsvd * pagesize);
+ swap_submit_derive (NULL, "in", (derive_t) pmemory.pgspins * pagesize);
+ swap_submit_derive (NULL, "out", (derive_t) pmemory.pgspouts * pagesize);
return (0);
} /* }}} int swap_read */