You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2013/02/22 07:15:28 UTC

svn commit: r1448909 - in /incubator/ambari/trunk: CHANGES.txt ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrd.py

Author: mahadev
Date: Fri Feb 22 06:15:28 2013
New Revision: 1448909

URL: http://svn.apache.org/r1448909
Log:
AMBARI-1466. Optimize ganglia rrd script to be able to respond within reasonable time to queries made by the UI. (mahadev)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrd.py

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1448909&r1=1448908&r2=1448909&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Fri Feb 22 06:15:28 2013
@@ -324,6 +324,9 @@ Trunk (unreleased changes):
  AMBARI-1465. Minimize Read and Write locks for createHosts. (Siddharth Wagle
  via mahadev)
 
+ AMBARI-1466. Optimize ganglia rrd script to be able to respond within
+ reasonable time to queries made by the UI. (mahadev)
+
  BUG FIXES
 
  AMBARI-1455. Setting App.testMode=true, alwaysGoToInstaller=true does not

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrd.py
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrd.py?rev=1448909&r1=1448908&r2=1448909&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrd.py (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-ganglia/files/rrd.py Fri Feb 22 06:15:28 2013
@@ -139,6 +139,14 @@ if "pt" in queryString:
 else:
   pointInTime = False
 
+
+host_metrics = ["boottime", "bytes_in", "bytes_out", "cpu_aidle", "cpu_idle",
+                "cpu_nice", "cpu_num", "cpu_speed", "cpu_system", "cpu_user",
+                "cpu_wio", "disk_free", "disk_total", "load_fifteen", "load_five",
+                "load_one", "mem_buffers", "mem_cached", "mem_free", "mem_shared",
+                "mem_total", "part_max_used", "pkts_in", "pkts_out", "proc_run",
+                "proc_total", "swap_free", "swap_total"]
+
 for cluster in clusterParts:
   for path, dirs, files in os.walk(rrdPath + cluster):
     pathParts = path.split("/")
@@ -146,10 +154,14 @@ for cluster in clusterParts:
       for file in files:
         for metric in metricParts:
           if file.endswith(metric + ".rrd"):
-
-            printMetric(pathParts[-2], pathParts[-1], file[:-4],
-                os.path.join(path, file), cf, start, end, resolution, pointInTime)
-
+            if not (metric in host_metrics):
+              printMetric(pathParts[-2], pathParts[-1], file[:-4],
+                    os.path.join(path, file), cf, start, end, resolution, pointInTime)
+            else:
+              if (cluster == "HDPSlaves"):
+                 printMetric(pathParts[-2], pathParts[-1], file[:-4],
+                    os.path.join(path, file), cf, start, end, resolution, pointInTime)
+                
 sys.stdout.write("[AMBARI_END]\n")
 # write end time
 sys.stdout.write(str(time.mktime(time.gmtime())))