From cb966fce03a0129ecaf028d0ff61bc543b343c5f Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Mon, 9 Oct 2017 17:22:00 +0700 Subject: [PATCH] memcached: Fix CPU usage reporting Signed-off-by: Florian Forster --- src/memcached.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } /* -- 2.30.2