X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fswap.c;h=cfde4ea6d2bd9d194abbab16d4d2269e7347e114;hb=1b4d95b869063e619bd7aae54cf37c5a1b91fbee;hp=a8276c7dd4267a0887a07a7547451a0a6eb76bf6;hpb=27894a14bcc5437d1e9131ea602c66c0e28fd9d1;p=collectd.git 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 */