From c9bea8828313ec45e4dd66049ca9a50fff789b4b 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 --- src/memcached.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } /* -- 2.30.2