X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fswap.c;h=cfde4ea6d2bd9d194abbab16d4d2269e7347e114;hb=791e99923dbbf045b11fbd7b0ea8df647e29593e;hp=a8276c7dd4267a0887a07a7547451a0a6eb76bf6;hpb=cedb6f147e94d0e952449f731313412ef4d67904;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 */