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~50 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c9bea8828313ec45e4dd66049ca9a50fff789b4b;p=collectd.git memcached: Fix CPU usage reporting --- diff --git a/src/memcached.c b/src/memcached.c index 90f323f8..30b4f6c4 100644 --- a/src/memcached.c +++ b/src/memcached.c @@ -436,9 +436,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; } /*