ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odiache...@apache.org
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 GMT
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 <odiachenko@pivotal.io>
Authored: Thu Feb 25 14:19:32 2016 -0800
Committer: Oleksandr Diachenko <odiachenko@pivotal.io>
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|


Mime
View raw message