Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 98FA218103 for ; Thu, 25 Feb 2016 22:19:44 +0000 (UTC) Received: (qmail 75934 invoked by uid 500); 25 Feb 2016 22:19:44 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 75903 invoked by uid 500); 25 Feb 2016 22:19:44 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 75894 invoked by uid 99); 25 Feb 2016 22:19:44 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Feb 2016 22:19:44 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 20904E8F26; Thu, 25 Feb 2016 22:19:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: odiachenko@apache.org To: commits@ambari.apache.org Message-Id: <3625d048d85d4f218359a83274e87f02@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-14658: Ambari Metrics service does not show data for swap_total memory metric(bhuvnesh chaudhary via odiachenko). Date: Thu, 25 Feb 2016 22:19:44 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/branch-2.2 b0a714937 -> ff93a998b AMBARI-14658: Ambari Metrics service does not show data for swap_total memory metric(bhuvnesh chaudhary via odiachenko). Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ff93a998 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ff93a998 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ff93a998 Branch: refs/heads/branch-2.2 Commit: ff93a998ba4232ed26b505dc30113cb422128e31 Parents: b0a7149 Author: Oleksandr Diachenko Authored: Thu Feb 25 14:19:32 2016 -0800 Committer: Oleksandr Diachenko Committed: Thu Feb 25 14:19:32 2016 -0800 ---------------------------------------------------------------------- .../src/main/python/core/host_info.py | 2 ++ .../src/main/resources/metrics_def/HOST.dat | 3 ++- .../src/test/resources/ui_metrics_def/HOST.dat | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/ff93a998/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py index 007dd42..2e8c442 100644 --- a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py +++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py @@ -113,6 +113,7 @@ class HostInfo(): swap_stats = psutil.swap_memory() disk_usage = self.get_combined_disk_usage() mem_total = self.__host_static_info.get('mem_total') + swap_total = self.__host_static_info.get('swap_total') bytes2kilobytes = lambda x: x / 1024 @@ -124,6 +125,7 @@ class HostInfo(): 'mem_buffered': bytes2kilobytes(mem_stats.buffers) if hasattr(mem_stats, 'buffers') else 0, 'mem_cached': bytes2kilobytes(mem_stats.cached) if hasattr(mem_stats, 'cached') else 0, 'swap_free': bytes2kilobytes(swap_stats.free) if hasattr(swap_stats, 'free') else 0, + 'swap_total': bytes2kilobytes(swap_total) if swap_total else 0, 'disk_free' : disk_usage.get("disk_free"), # todo: cannot send string #'part_max_used' : disk_usage.get("max_part_used")[0], http://git-wip-us.apache.org/repos/asf/ambari/blob/ff93a998/ambari-metrics/ambari-metrics-timelineservice/src/main/resources/metrics_def/HOST.dat ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/resources/metrics_def/HOST.dat b/ambari-metrics/ambari-metrics-timelineservice/src/main/resources/metrics_def/HOST.dat index c940800..9295692 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/src/main/resources/metrics_def/HOST.dat +++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/resources/metrics_def/HOST.dat @@ -20,4 +20,5 @@ mem_free mem_shared pkts_in pkts_out -swap_free \ No newline at end of file +swap_free +swap_total http://git-wip-us.apache.org/repos/asf/ambari/blob/ff93a998/ambari-metrics/ambari-metrics-timelineservice/src/test/resources/ui_metrics_def/HOST.dat ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/test/resources/ui_metrics_def/HOST.dat b/ambari-metrics/ambari-metrics-timelineservice/src/test/resources/ui_metrics_def/HOST.dat index 96e7ddd..b201515 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/src/test/resources/ui_metrics_def/HOST.dat +++ b/ambari-metrics/ambari-metrics-timelineservice/src/test/resources/ui_metrics_def/HOST.dat @@ -75,5 +75,6 @@ mem_shared mem_free cpu_nice swap_free +swap_total pkts_out -|hostname|startTime|endTime| \ No newline at end of file +|hostname|startTime|endTime|