ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swa...@apache.org
Subject ambari git commit: AMBARI-17600. System boottime metric is not being collected by AMS. (swagle)
Date Thu, 07 Jul 2016 00:48:26 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 b261dbd5d -> be18a92c9


AMBARI-17600. System boottime metric is not being collected by AMS. (swagle)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/be18a92c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/be18a92c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/be18a92c

Branch: refs/heads/branch-2.4
Commit: be18a92c98bc3499d869aada43bd00b99c855f19
Parents: b261dbd
Author: Siddharth Wagle <swagle@hortonworks.com>
Authored: Wed Jul 6 17:48:21 2016 -0700
Committer: Siddharth Wagle <swagle@hortonworks.com>
Committed: Wed Jul 6 17:48:21 2016 -0700

----------------------------------------------------------------------
 .../src/main/python/core/host_info.py                          | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/be18a92c/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 ccc1366..5e88412 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
@@ -53,6 +53,9 @@ class HostInfo():
     """
     cpu_times = psutil.cpu_times_percent()
     cpu_count = self.__host_static_info.get('cpu_num', 1)
+    # Since only boot time which is a part of static info is not sent with
+    # other payload sending it with cpu stats.
+    boot_time = self.__host_static_info.get('boot_time')
 
     result = {
       'cpu_num': int(cpu_count),
@@ -63,7 +66,8 @@ class HostInfo():
       'cpu_wio': cpu_times.iowait if hasattr(cpu_times, 'iowait') else 0,
       'cpu_intr': cpu_times.irq if hasattr(cpu_times, 'irq') else 0,
       'cpu_sintr': cpu_times.softirq if hasattr(cpu_times, 'softirq') else 0,
-      'cpu_steal': cpu_times.steal if hasattr(cpu_times, 'steal') else 0
+      'cpu_steal': cpu_times.steal if hasattr(cpu_times, 'steal') else 0,
+      'boot_time': long(boot_time) if boot_time else 0
     }
     if platform.system() != "Windows":
       load_avg = os.getloadavg()


Mime
View raw message