Implemented default health stat reader logic
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/2d9f1ece Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/2d9f1ece Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/2d9f1ece Branch: refs/heads/master Commit: 2d9f1eced6ca95fb6f63eb8d3c4e54c8a407009b Parents: 1c2f046 Author: Chamila de Alwis <[email protected]> Authored: Wed Oct 1 16:28:37 2014 +0530 Committer: Chamila de Alwis <[email protected]> Committed: Thu Oct 9 15:40:28 2014 +0530 ---------------------------------------------------------------------- .../modules/healthstatspublisher/healthstats.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/2d9f1ece/tools/python-cartridge-agent/cartridge-agent/modules/healthstatspublisher/healthstats.py ---------------------------------------------------------------------- diff --git a/tools/python-cartridge-agent/cartridge-agent/modules/healthstatspublisher/healthstats.py b/tools/python-cartridge-agent/cartridge-agent/modules/healthstatspublisher/healthstats.py index f647106..d631b82 100644 --- a/tools/python-cartridge-agent/cartridge-agent/modules/healthstatspublisher/healthstats.py +++ b/tools/python-cartridge-agent/cartridge-agent/modules/healthstatspublisher/healthstats.py @@ -1,6 +1,8 @@ from threading import Thread import time import logging +import psutil +import os from abstracthealthstatisticspublisher import * from ..databridge.agent import * @@ -138,11 +140,12 @@ class DefaultHealthStatisticsReader(AbstractHealthStatisticsReader): @staticmethod def __read_mem_usage(): - raise NotImplementedError + return psutil.virtual_memory().percent @staticmethod def __read_load_avg(): - raise NotImplementedError + (one, five, fifteen) = os.getloadavg() + return one class CEPPublisherConfiguration:
