From 41e297ca4f9d4a74429e793af13f532a96fd9441 Mon Sep 17 00:00:00 2001 From: Satheesh Rajendran Date: Fri, 21 Apr 2017 15:22:12 +0530 Subject: [PATCH] Added method to get total cpus count Added method to get total cpus count Signed-off-by: Satheesh Rajendran --- client/base_utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/base_utils.py b/client/base_utils.py index 2aca7c8f0b..d34b240b4c 100644 --- a/client/base_utils.py +++ b/client/base_utils.py @@ -406,6 +406,11 @@ def count_cpus(): return os.sysconf('SC_NPROCESSORS_ONLN') +def count_total_cpus(): + """Total number of (online+offline) CPUs in the local machine""" + return os.sysconf('SC_NPROCESSORS_CONF') + + def sysctl(key, value=None): """Generic implementation of sysctl, to read and write.