chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r773141 - in /hadoop/chukwa/trunk: ./ src/java/org/apache/hadoop/chukwa/hicc/ src/web/hicc/descriptors/ src/web/hicc/js/ src/web/hicc/jsp/
Date Sat, 09 May 2009 00:19:33 GMT
Author: eyang
Date: Sat May  9 00:19:32 2009
New Revision: 773141

URL: http://svn.apache.org/viewvc?rev=773141&view=rev
Log:
CHUKWA-220. Correct min, max settings for yaxis charting. (Terence Kwan via Eric Yang)

Modified:
    hadoop/chukwa/trunk/CHANGES.txt
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/hicc/Chart.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/hicc/Workspace.java
    hadoop/chukwa/trunk/src/web/hicc/descriptors/cluster_disk_pcnt.descriptor
    hadoop/chukwa/trunk/src/web/hicc/descriptors/cluster_metrics_pcnt.descriptor
    hadoop/chukwa/trunk/src/web/hicc/descriptors/disk_pcnt.descriptor
    hadoop/chukwa/trunk/src/web/hicc/descriptors/system_metrics_pcnt.descriptor
    hadoop/chukwa/trunk/src/web/hicc/js/flot.extend.js
    hadoop/chukwa/trunk/src/web/hicc/jsp/single-series-chart-javascript.jsp

Modified: hadoop/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/CHANGES.txt?rev=773141&r1=773140&r2=773141&view=diff
==============================================================================
--- hadoop/chukwa/trunk/CHANGES.txt (original)
+++ hadoop/chukwa/trunk/CHANGES.txt Sat May  9 00:19:32 2009
@@ -38,6 +38,8 @@
 
   IMPROVEMENTS
 
+    CHUKWA-219. Improved usability of host selector, and updated caching for host list. (Eric
Yang)
+
     CHUKWA-104. Remove permission setting code for Log4JMetricsContext and ChukwaDailyRollingFileAppender.
 (Jerome Boulon via Eric Yang)
 
     CHUKWA-178. Extend aggregation by 5 minutes for cluster metrics. (Eric Yang)

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/hicc/Chart.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/hicc/Chart.java?rev=773141&r1=773140&r2=773141&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/hicc/Chart.java (original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/hicc/Chart.java Sat May  9 00:19:32
2009
@@ -54,9 +54,12 @@
   private String yRightLabel = "";
   private int datasetCounter = 0;
   private double max = 0;
+  private double min = 0;
   private int seriesCounter = 0;
   private List<String> rightList;
   private boolean userDefinedMax = false;
+  private boolean userDefinedMin = false;
+  private boolean displayPercentage = false;
   private String[] seriesOrder = null;
   private XssFilter xf = null;
   
@@ -80,6 +83,8 @@
     this.seriesCounter = 0;
     this.rightList = new ArrayList<String>();
     this.userDefinedMax = false;
+    this.userDefinedMin = false;
+    this.displayPercentage = false;
     this.seriesOrder = null;
   }
 
@@ -88,6 +93,15 @@
     this.userDefinedMax = true;
   }
 
+  public void setYMin(double min) {
+    this.min = min;
+    this.userDefinedMin = true;
+  }
+
+  public void setDisplayPercentage(boolean percentage) {
+    this.displayPercentage = percentage;
+  }
+
   public void setSize(int width, int height) {
     this.width = width;
     this.height = height;
@@ -202,7 +216,7 @@
       output
           .append("<html><link href=\"/hicc/css/default.css\" rel=\"stylesheet\"
type=\"text/css\">\n");
       output
-          .append("<body onresize=\"wholePeriod();\"><script type=\"text/javascript\"
src=\"/hicc/js/jquery-1.2.6.min.js\"></script>\n");
+          .append("<body><script type=\"text/javascript\" src=\"/hicc/js/jquery-1.2.6.min.js\"></script>\n");
       output
           .append("<script type=\"text/javascript\" src=\"/hicc/js/jquery.flot.pack.js\"></script>\n");
       output
@@ -231,7 +245,7 @@
     output.append("_options={\n");
     output.append("        points: { show: false },\n");
     output.append("        xaxis: { " + xAxisOptions + " },\n");
-    output.append("	  selection: { mode: \"x\" },\n");
+    output.append("	  selection: { mode: \"xy\" },\n");
     output.append("	  grid: {\n");
     output.append("	           clickable: true,\n");
     output.append("	           hoverable: true,\n");
@@ -250,7 +264,7 @@
     if (stack) {
       output.append("mode: \"stack\", ");
     }
-    if (userDefinedMax) {
+    if (displayPercentage) {
       output
           .append("tickFormatter: function(val, axis) { return val.toFixed(axis.tickDecimals)
+ \" %\"; }");
     } else {
@@ -283,8 +297,12 @@
           .append("else if (val >= 2000) return (val / 1000).toFixed(2) + \"x10<sup>3</sup>\";");
       output.append("else return val.toFixed(2) + \"\"; }");
     }
+    if (userDefinedMin) {
+      output.append(", min:");
+      output.append(this.min);
+    }
     if (userDefinedMax) {
-      output.append(", min:0, max:");
+      output.append(", max:");
       output.append(this.max);
     }
     output.append("}\n");
@@ -366,26 +384,26 @@
             }
             if (xLabel.equals("Time")) {
               if (data.get(dp) == Double.NaN) {
-                output.append("[\"");
+                output.append("[");
                 output.append(dp);
-                output.append("\",NULL]");
+                output.append(",NULL]");
               } else {
-                output.append("[\"");
+                output.append("[");
                 output.append(dp);
-                output.append("\",");
+                output.append(",");
                 output.append(data.get(dp));
                 output.append("]");
               }
             } else {
               long value = xLabelRangeHash.get(dp);
               if (data.get(dp) == Double.NaN) {
-                output.append("[\"");
+                output.append("[");
                 output.append(value);
-                output.append("\",NULL]");
+                output.append(",NULL]");
               } else {
-                output.append("[\"");
+                output.append("[");
                 output.append(value);
-                output.append("\",");
+                output.append(",");
                 output.append(data.get(dp));
                 output.append("]");
               }
@@ -406,7 +424,12 @@
     }
     output.append(" ];\n");
     if (request != null && xf.getParameter("format") == null) {
-      output.append(" wholePeriod();</script></body></html>\n");
+	output.append("$(document).ready(function() { \n");
+	output.append("   wholePeriod();\n");
+	output.append("   $(window).resize(function() { wholePeriod(); });\n");
+	output.append("});\n");
+	output.append("</script>\n");
+	output.append("</body></html>\n");
     } else {
       output.append("chartTitle=\"<center>" + this.title + "</center>\";");
       output.append("height=" + this.height + ";");

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/hicc/Workspace.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/hicc/Workspace.java?rev=773141&r1=773140&r2=773141&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/hicc/Workspace.java (original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/hicc/Workspace.java Sat May  9 00:19:32
2009
@@ -154,6 +154,7 @@
       HttpServletResponse response) throws IOException, ServletException {
     PrintWriter out = response.getWriter();
     String format = xf.getParameter("format");
+    genViewCache(path + "/views");
     File aFile = new File(path + "/views/workspace_view_list.cache");
     String viewsCache = getContents(aFile);
     out.println(viewsCache);

Modified: hadoop/chukwa/trunk/src/web/hicc/descriptors/cluster_disk_pcnt.descriptor
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/web/hicc/descriptors/cluster_disk_pcnt.descriptor?rev=773141&r1=773140&r2=773141&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/web/hicc/descriptors/cluster_disk_pcnt.descriptor (original)
+++ hadoop/chukwa/trunk/src/web/hicc/descriptors/cluster_disk_pcnt.descriptor Sat May  9 00:19:32
2009
@@ -11,6 +11,7 @@
 {"name":"table","type":"string","value":"cluster_disk","edit":"0"},
 {"name":"group_override","type":"string","value":"mount","edit":"0"},
 {"name":"y_axis_max","type":"string","value":"100","edit":"0"},
+{"name":"display_percentage","type":"string","value":"1","edit":"0"},
 {"name":"metric","type":"string","value":"used_percent","edit":"0"},
 {"name":"period","type":"select","value":"","label":"Period","options":[
 {"label":"Use Time Widget","value":""},

Modified: hadoop/chukwa/trunk/src/web/hicc/descriptors/cluster_metrics_pcnt.descriptor
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/web/hicc/descriptors/cluster_metrics_pcnt.descriptor?rev=773141&r1=773140&r2=773141&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/web/hicc/descriptors/cluster_metrics_pcnt.descriptor (original)
+++ hadoop/chukwa/trunk/src/web/hicc/descriptors/cluster_metrics_pcnt.descriptor Sat May 
9 00:19:32 2009
@@ -9,6 +9,7 @@
 "refresh":"15",
 "parameters":[
 {"name":"y_axis_max","type":"string","value":"100","edit":"0"},
+{"name":"display_percentage","type":"string","value":"1","edit":"0"},
 {"name":"table","type":"string","value":"cluster_system_metrics","edit":"0"},
 {"name":"period","type":"select","value":"","label":"Period","options":[
 {"label":"Use Time Widget","value":""},

Modified: hadoop/chukwa/trunk/src/web/hicc/descriptors/disk_pcnt.descriptor
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/web/hicc/descriptors/disk_pcnt.descriptor?rev=773141&r1=773140&r2=773141&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/web/hicc/descriptors/disk_pcnt.descriptor (original)
+++ hadoop/chukwa/trunk/src/web/hicc/descriptors/disk_pcnt.descriptor Sat May  9 00:19:32
2009
@@ -11,6 +11,7 @@
 {"name":"table","type":"string","value":"disk","edit":"0"},
 {"name":"group_override","type":"string","value":"concat(host,mount) as mount","edit":"0"},
 {"name":"y_axis_max","type":"string","value":"100","edit":"0"},
+{"name":"display_percentage","type":"string","value":"1","edit":"0"},
 {"name":"metric","type":"string","value":"used_percent","edit":"0"},
 {"name":"group","type":"string","value":"host","edit":"0"},
 {"name":"group_items","type":"string","value":"hosts","edit":"0"},

Modified: hadoop/chukwa/trunk/src/web/hicc/descriptors/system_metrics_pcnt.descriptor
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/web/hicc/descriptors/system_metrics_pcnt.descriptor?rev=773141&r1=773140&r2=773141&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/web/hicc/descriptors/system_metrics_pcnt.descriptor (original)
+++ hadoop/chukwa/trunk/src/web/hicc/descriptors/system_metrics_pcnt.descriptor Sat May  9
00:19:32 2009
@@ -12,6 +12,7 @@
 {"name":"group","type":"string","value":"host","edit":"0"},
 {"name":"group_items","type":"string","value":"hosts","edit":"0"},
 {"name":"y_axis_max","type":"string","value":"100","edit":"0"},
+{"name":"display_percentage","type":"string","value":"1","edit":"0"},
 {"name":"period","type":"select","value":"","label":"Period","options":[
 {"label":"Use Time Widget","value":""},
 {"label":"Last 1 Hour","value":"last1hr"},

Modified: hadoop/chukwa/trunk/src/web/hicc/js/flot.extend.js
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/web/hicc/js/flot.extend.js?rev=773141&r1=773140&r2=773141&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/web/hicc/js/flot.extend.js (original)
+++ hadoop/chukwa/trunk/src/web/hicc/js/flot.extend.js Sat May  9 00:19:32 2009
@@ -77,15 +77,16 @@
          });
 	$("#placeholder").bind("selected", function (event, area) {
             zoom = true;
+	     extra_options = {};
+	     extra_options.xaxis={ min: area.x1, max: area.x2 };	       
+	     extra_options.yaxis={ min: area.y1, max: area.y2 };
 			plot = $.plot(
 				$("#placeholder"),
 				_series,
 				$.extend(
 					true, 
 					{}, 
-					_options, {
-						xaxis: { min: area.x1, max: area.x2 }
-					}
+					_options, extra_options
 				)
 			);
 		});

Modified: hadoop/chukwa/trunk/src/web/hicc/jsp/single-series-chart-javascript.jsp
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/web/hicc/jsp/single-series-chart-javascript.jsp?rev=773141&r1=773140&r2=773141&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/web/hicc/jsp/single-series-chart-javascript.jsp (original)
+++ hadoop/chukwa/trunk/src/web/hicc/jsp/single-series-chart-javascript.jsp Sat May  9 00:19:32
2009
@@ -218,6 +218,9 @@
                double max = Double.parseDouble(xf.getParameter("y_axis_max"));
                c.setYMax(max);
            }
+           if(request.getParameter("display_percentage")!=null) {
+	       c.setDisplayPercentage(true);
+	   }
            if(request.getParameter("legend")!=null && xf.getParameter("legend").equals("off"))
{
                c.setLegend(false);
            }



Mime
View raw message