incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1185352 - in /incubator/accumulo/trunk/src/server/src/main: java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java resources/web/screen.css
Date Mon, 17 Oct 2011 20:19:48 GMT
Author: kturner
Date: Mon Oct 17 20:19:48 2011
New Revision: 1185352

URL: http://svn.apache.org/viewvc?rev=1185352&view=rev
Log:
ACCUMULO-4 improved look of plots on monitor page

Modified:
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
    incubator/accumulo/trunk/src/server/src/main/resources/web/screen.css

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java?rev=1185352&r1=1185351&r2=1185352&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
Mon Oct 17 20:19:48 2011
@@ -138,9 +138,9 @@ public class DefaultServlet extends Basi
 
 	@SuppressWarnings("unchecked")
 	private static void plotData(StringBuilder sb, String title, @SuppressWarnings("rawtypes")
List data, boolean points){
-		sb.append("<center>");
+		sb.append("<div class=\"plotHeading\">");
 		sb.append(title);
-		sb.append("</center>");
+		sb.append("</div>");
 		sb.append("</br>");
 		String id = "c"+title.hashCode();
 		sb.append("<div id=\""+id+"\" style=\"width:" + GRAPH_WIDTH + "px;height:" + GRAPH_HEIGHT
+ "px;\"></div>\n");
@@ -153,17 +153,24 @@ public class DefaultServlet extends Basi
 		for(Pair<Long, ? extends Number> point : (List<Pair<Long, ? extends Number>>)data){
 			if(point.getSecond() == null)
 				continue;
+			
+			String y;
+			if(point.getSecond() instanceof Double)
+				y = String.format("%1.2f", point.getSecond());
+			else
+				y = point.getSecond().toString();
+			
 			sb.append(sep);
 			sep = ",";
-			sb.append("["+point.getFirst()+","+point.getSecond()+"]");
+			sb.append("["+point.getFirst()+","+y+"]");
 		}
 		
 		String opts = "lines: { show: true }";
 		if(points)
-			opts = "points: { show: true }";
+			opts = "points: { show: true, radius: 1 }";
 		
 		sb.append("    ];\n");
-		sb.append("    $.plot($(\"#"+id+"\"), [{ data: d1, "+opts+" }], {yaxis:{}, xaxis:{mode:\"time\",minTickSize:
[1, \"minute\"],timeformat: \"%H:%M\", ticks:3}});");
+		sb.append("    $.plot($(\"#"+id+"\"), [{ data: d1, "+opts+", color:\"red\" }], {yaxis:{},
xaxis:{mode:\"time\",minTickSize: [1, \"minute\"],timeformat: \"%H:%M\", ticks:3}});");
 		sb.append("   });\n");
 		sb.append("</script>\n");
 	}
@@ -197,7 +204,7 @@ public class DefaultServlet extends Basi
 		sb.append("</tr></table>\n");
 		sb.append("<br/>\n");
 
-		sb.append("<p/><table>\n");
+		sb.append("<p/><table class=\"noborder\">\n");
 		
 		sb.append("<tr><td>\n");
 		plotData(sb, "Ingest (Entries/s)", Monitor.getIngestRateOverTime(), false);

Modified: incubator/accumulo/trunk/src/server/src/main/resources/web/screen.css
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/resources/web/screen.css?rev=1185352&r1=1185351&r2=1185352&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/resources/web/screen.css (original)
+++ incubator/accumulo/trunk/src/server/src/main/resources/web/screen.css Mon Oct 17 20:19:48
2011
@@ -271,4 +271,9 @@ pre.logevent {
 .center {
 	text-align: center;
 	padding: 0.5em;
+}
+
+.plotHeading {
+    text-align: center;
+    font-size: 1.5em;
 }
\ No newline at end of file



Mime
View raw message