Fixed loadavg reading issue
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/55e7ea00 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/55e7ea00 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/55e7ea00 Branch: refs/heads/master Commit: 55e7ea003b7e517d44d2013c5c187d0d5c234623 Parents: 7f8ef63 Author: Chamila de Alwis <[email protected]> Authored: Thu Oct 23 15:28:05 2014 +0530 Committer: Chamila de Alwis <[email protected]> Committed: Thu Oct 23 15:28:05 2014 +0530 ---------------------------------------------------------------------- .../cartridgeagent/modules/healthstatspublisher/healthstats.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/55e7ea00/tools/python_cartridgeagent/cartridgeagent/modules/healthstatspublisher/healthstats.py ---------------------------------------------------------------------- diff --git a/tools/python_cartridgeagent/cartridgeagent/modules/healthstatspublisher/healthstats.py b/tools/python_cartridgeagent/cartridgeagent/modules/healthstatspublisher/healthstats.py index 4ceb948..6bb574b 100644 --- a/tools/python_cartridgeagent/cartridgeagent/modules/healthstatspublisher/healthstats.py +++ b/tools/python_cartridgeagent/cartridgeagent/modules/healthstatspublisher/healthstats.py @@ -19,6 +19,7 @@ from threading import Thread import time import psutil import os +import multiprocessing from abstracthealthstatisticspublisher import * from ..databridge.agent import * @@ -181,7 +182,9 @@ class DefaultHealthStatisticsReader(AbstractHealthStatisticsReader): @staticmethod def __read_load_avg(): (one, five, fifteen) = os.getloadavg() - return one + cores = multiprocessing.cpu_count() + + return (one/cores) * 100 class CEPPublisherConfiguration:
