From: Marek Becka Date: Tue, 9 Jun 2015 20:56:55 +0000 (-0400) Subject: swap plugin: Report swap sizes in bytes. X-Git-Tag: collectd-5.5.1~124 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=871b643dc18d7ffe0ba8334dc5fb222741433774;p=collectd.git swap plugin: Report swap sizes in bytes. Regression from 43aa1c5cc9ab69004d0fe6de480c78815224111b. --- diff --git a/src/swap.c b/src/swap.c index a8276c7d..cfde4ea6 100644 --- a/src/swap.c +++ b/src/swap.c @@ -281,7 +281,8 @@ static int swap_read_separate (void) /* {{{ */ if (total < used) continue; - swap_submit_usage (path, used, total - used, NULL, NAN); + swap_submit_usage (path, used * 1024.0, (total - used) * 1024.0, + NULL, NAN); } fclose (fh); @@ -340,8 +341,9 @@ static int swap_read_combined (void) /* {{{ */ if (swap_used < 0.0) return (EINVAL); - swap_submit_usage (NULL, swap_used, swap_free, - isnan (swap_cached) ? NULL : "cached", swap_cached); + swap_submit_usage (NULL, swap_used * 1024.0, swap_free * 1024.0, + isnan (swap_cached) ? NULL : "cached", + isnan (swap_cached) ? NAN : swap_cached * 1024.0); return (0); } /* }}} int swap_read_combined */