From: Pavel Rochnyack Date: Mon, 9 Oct 2017 10:22:00 +0000 (+0700) Subject: memcached: Fix CPU usage reporting X-Git-Tag: collectd-5.8.0~1^2~8^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcollectd-5.6;p=collectd.git memcached: Fix CPU usage reporting Signed-off-by: Florian Forster --- diff --git a/src/memcached.c b/src/memcached.c index 02215e1c..6c6f88f3 100644 --- a/src/memcached.c +++ b/src/memcached.c @@ -364,9 +364,10 @@ static int memcached_read(user_data_t *user_data) { * CPU time consumed by the memcached process */ if (FIELD_IS("rusage_user")) { - rusage_user = atoll(fields[2]); + /* Convert to useconds */ + rusage_user = atof(fields[2]) * 1000000; } else if (FIELD_IS("rusage_system")) { - rusage_syst = atoll(fields[2]); + rusage_syst = atof(fields[2]) * 1000000; } /*