incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [2/3] git commit: Modified the metrics page to use the new metrics from com.yammer.metrics.reporting.MetricsServlet. Also got rid of the old files
Date Wed, 22 May 2013 00:58:17 GMT
Modified the metrics page to use the new metrics from com.yammer.metrics.reporting.MetricsServlet.
Also got rid of the old files

Signed-off-by: Aaron McCurry <amccurry@gmail.com>


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

Branch: refs/heads/0.1.5
Commit: b49f65531a3de99354c8355aeb25dfc9478df842
Parents: f5949e5
Author: Rahul Challapalli <challapallirahul@gmail.com>
Authored: Sun May 19 16:28:04 2013 -0700
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue May 21 20:50:22 2013 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/blur/gui/HeapMetrics.java |   86 -----
 .../org/apache/blur/gui/LiveMetricsServlet.java    |   19 +-
 .../java/org/apache/blur/gui/QueryMetrics.java     |  180 -----------
 .../org/apache/blur/gui/SystemLoadMetrics.java     |   72 -----
 src/blur-gui/src/main/webapp/footer.jsp            |    2 +-
 src/blur-gui/src/main/webapp/metrics.jsp           |  242 ++++++++-------
 src/blur-gui/src/main/webapp/style.css             |   15 +
 7 files changed, 156 insertions(+), 460 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b49f6553/src/blur-gui/src/main/java/org/apache/blur/gui/HeapMetrics.java
----------------------------------------------------------------------
diff --git a/src/blur-gui/src/main/java/org/apache/blur/gui/HeapMetrics.java b/src/blur-gui/src/main/java/org/apache/blur/gui/HeapMetrics.java
deleted file mode 100644
index 4901128..0000000
--- a/src/blur-gui/src/main/java/org/apache/blur/gui/HeapMetrics.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.apache.blur.gui;
-
-import java.io.PrintWriter;
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryUsage;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.concurrent.TimeUnit;
-
-public class HeapMetrics extends TimerTask {
-
-  private static final double ONE_GIG = 1024 * 1024 * 1024;
-  private final int sampleSize = (int) TimeUnit.MINUTES.toSeconds(10);
-  private final Timer timer;
-  private final long period = TimeUnit.SECONDS.toMillis(1);
-  private final long[] heapMemoryUsageUsedHistory = new long[sampleSize];
-  private final long[] heapMemoryUsageCommittedHistory = new long[sampleSize];
-  private final long[] timestamp = new long[sampleSize];
-  private volatile static HeapMetrics heapMetrics;
-  private volatile int position = 0;
-
-  public static synchronized HeapMetrics getInstance() {
-    if (heapMetrics == null) {
-      heapMetrics = new HeapMetrics();
-    }
-    return heapMetrics;
-  }
-
-  private HeapMetrics() {
-    timer = new Timer("HeapMetrics", true);
-    timer.scheduleAtFixedRate(this, period, period);
-  }
-
-  @Override
-  public void run() {
-    synchronized (this) {
-      if (position >= sampleSize) {
-        position = 0;
-      }
-      MemoryUsage heapMemoryUsage = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
-      setValue(heapMemoryUsage.getUsed(), heapMemoryUsageUsedHistory);
-      setValue(heapMemoryUsage.getCommitted(), heapMemoryUsageCommittedHistory);
-      setValue(System.currentTimeMillis(), timestamp);
-      position++;
-    }
-  }
-
-  private void setValue(long value, long[] history) {
-    history[position] = value;
-  }
-
-  public void writeJson(PrintWriter out) {
-    synchronized (this) {
-      out.print("{\"labels\":[");
-      out.print("{\"name\":\"used\",\"style\":{\"stroke\":\"RoyalBlue\"}},");
-      out.print("{\"name\":\"committed\",\"style\":{\"stroke\":\"Red\"}},");
-      out.print("],\"data\":[");
-      int p = position;
-      boolean comma = false;
-      for (int i = 0; i < sampleSize; i++, p++) {
-        if (p >= sampleSize) {
-          p = 0;
-        }
-        double used = ((double) heapMemoryUsageUsedHistory[p]) / ONE_GIG;
-        double committed = ((double) heapMemoryUsageCommittedHistory[p]) / ONE_GIG;
-
-        long t = timestamp[p];
-        if (t == 0) {
-          continue;
-        }
-        if (comma) {
-          out.print(",");
-        }
-        out.print("{\"used\":");
-        out.print(used);
-        out.print(",\"committed\":");
-        out.print(committed);
-        out.print(",\"recordTime\":");
-        out.print(t);
-        out.print('}');
-        comma = true;
-      }
-      out.print("]}");
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b49f6553/src/blur-gui/src/main/java/org/apache/blur/gui/LiveMetricsServlet.java
----------------------------------------------------------------------
diff --git a/src/blur-gui/src/main/java/org/apache/blur/gui/LiveMetricsServlet.java b/src/blur-gui/src/main/java/org/apache/blur/gui/LiveMetricsServlet.java
index 945755e..c91fbad 100644
--- a/src/blur-gui/src/main/java/org/apache/blur/gui/LiveMetricsServlet.java
+++ b/src/blur-gui/src/main/java/org/apache/blur/gui/LiveMetricsServlet.java
@@ -29,18 +29,16 @@ public class LiveMetricsServlet extends HttpServlet {
 
   private static final long serialVersionUID = 1L;
 
-  private HeapMetrics heapMetrics;
-  private SystemLoadMetrics systemLoadMetrics;
-  private QueryMetrics queryMetrics;
-
-  public LiveMetricsServlet() {
-    heapMetrics = HeapMetrics.getInstance();
-    systemLoadMetrics = SystemLoadMetrics.getInstance();
-    queryMetrics = QueryMetrics.getInstance();
-  }
+  
+  public LiveMetricsServlet() {}
 
   protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
-    response.setContentType("application/json");
+    /*
+     * The live metrics page is currently not being used
+     */
+     
+	/* 
+	response.setContentType("application/json");
     PrintWriter out = response.getWriter();
     out.write("{");
     out.write("\"jvm\":{\"xLabel\":\"Time\",\"yLabel\":\"Heap (GB)\",\"lines\":");
@@ -56,6 +54,7 @@ public class LiveMetricsServlet extends HttpServlet {
     systemLoadMetrics.writeJson(out);
     out.write("}");
     out.write("}");
+    */
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b49f6553/src/blur-gui/src/main/java/org/apache/blur/gui/QueryMetrics.java
----------------------------------------------------------------------
diff --git a/src/blur-gui/src/main/java/org/apache/blur/gui/QueryMetrics.java b/src/blur-gui/src/main/java/org/apache/blur/gui/QueryMetrics.java
deleted file mode 100644
index 05ddcae..0000000
--- a/src/blur-gui/src/main/java/org/apache/blur/gui/QueryMetrics.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package org.apache.blur.gui;
-
-import java.io.PrintWriter;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
-
-public class QueryMetrics extends TimerTask {
-
-  private final int sampleSize = (int) TimeUnit.MINUTES.toSeconds(10);
-  private final AtomicLong _queryCount = new AtomicLong();
-  private final AtomicLong _queryTime = new AtomicLong();
-  private final AtomicLong _queryExceptionCount = new AtomicLong();
-  private final AtomicLong _dataFetchCount = new AtomicLong();
-  private final AtomicLong _dataFetchTime = new AtomicLong();
-  private final AtomicLong _dataFetchRecordCount = new AtomicLong();
-  private final AtomicLong _dataMutateCount = new AtomicLong();
-  private final AtomicLong _dataMutateTime = new AtomicLong();
-  private final AtomicLong _dataMutateRecordCount = new AtomicLong();
-  private final Timer timer;
-  private final long period = TimeUnit.SECONDS.toMillis(1);
-  private final double[] _queryRate = new double[sampleSize];
-  private final double[] _queryResponse = new double[sampleSize];
-  private final double[] _queryExceptionRate = new double[sampleSize];
-  private final double[] _fetchRate = new double[sampleSize];
-  private final double[] _fetchResponse = new double[sampleSize];
-  private final double[] _fetchRecordRate = new double[sampleSize];
-  private final double[] _mutateRate = new double[sampleSize];
-  private final double[] _mutateResponse = new double[sampleSize];
-  private final double[] _mutateRecordRate = new double[sampleSize];
-  private final long[] timestamp = new long[sampleSize];
-  private volatile static QueryMetrics instance;
-  private volatile int position;
-
-  public static synchronized QueryMetrics getInstance() {
-    if (instance == null) {
-      instance = new QueryMetrics();
-    }
-    return instance;
-  }
-
-  private QueryMetrics() {
-    timer = new Timer("QueryMetrics", true);
-    timer.scheduleAtFixedRate(this, period, period);
-  }
-
-  @Override
-  public void run() {
-    synchronized (this) {
-      if (position >= sampleSize) {
-        position = 0;
-      }
-      long queryCount = _queryCount.getAndSet(0);
-      long queryTime = _queryTime.getAndSet(0);
-      long queryExceptionCount = _queryExceptionCount.getAndSet(0);
-
-      long dataFetchCount = _dataFetchCount.getAndSet(0);
-      long dataFetchTime = _dataFetchTime.getAndSet(0);
-      long dataFetchRecordCount = _dataFetchRecordCount.getAndSet(0);
-
-      long dataMutateCount = _dataMutateCount.getAndSet(0);
-      long dataMutateTime = _dataMutateTime.getAndSet(0);
-      long dataMutateRecordCount = _dataMutateRecordCount.getAndSet(0);
-
-      _queryRate[position] = queryCount;
-      _queryResponse[position] = TimeUnit.NANOSECONDS.toMillis(queryTime) / (double) queryCount;
-
-      _queryExceptionRate[position] = queryExceptionCount;
-
-      _fetchRate[position] = dataFetchCount;
-      _fetchResponse[position] = TimeUnit.NANOSECONDS.toMillis(dataFetchTime) / (double)
dataFetchCount;
-      _fetchRecordRate[position] = dataFetchRecordCount;
-
-      _mutateRate[position] = dataMutateCount;
-      _mutateResponse[position] = TimeUnit.NANOSECONDS.toMillis(dataMutateTime) / (double)
dataMutateCount;
-      _mutateRecordRate[position] = dataMutateRecordCount;
-
-      timestamp[position] = System.currentTimeMillis();
-      position++;
-    }
-  }
-
-  public void recordQuery(long totalTimeNs) {
-    _queryCount.incrementAndGet();
-    _queryTime.addAndGet(totalTimeNs);
-  }
-
-  public void recordQueryExceptions() {
-    _queryExceptionCount.incrementAndGet();
-  }
-
-  public void recordDataFetch(long totalTimeNs, long records) {
-    _dataFetchCount.incrementAndGet();
-    _dataFetchTime.addAndGet(totalTimeNs);
-    _dataFetchRecordCount.addAndGet(records);
-  }
-
-  public void recordDataMutate(long totalTimeNs, long records) {
-    _dataMutateCount.incrementAndGet();
-    _dataMutateTime.addAndGet(totalTimeNs);
-    _dataMutateRecordCount.addAndGet(records);
-  }
-
-  public void writeGraph1Json(PrintWriter out) {
-    synchronized (this) {
-      out.print("{\"labels\":[");
-      out.print("{\"name\":\"query\",\"style\":{\"stroke\":\"RoyalBlue\"}},");
-      out.print("{\"name\":\"fetch\",\"style\":{\"stroke\":\"Black\"}},");
-      out.print("{\"name\":\"mutate\",\"style\":{\"stroke\":\"Orange\"}},");
-      out.print("{\"name\":\"except\",\"style\":{\"stroke\":\"Red\"}}");
-      out.print("],\"data\":[");
-      int p = position;
-      boolean comma = false;
-      for (int i = 0; i < sampleSize; i++, p++) {
-        if (p >= sampleSize) {
-          p = 0;
-        }
-        double query = _queryRate[p];
-        double fetch = _fetchRate[p];
-        double mutate = _mutateRate[p];
-        double except = _queryExceptionRate[p];
-        long t = timestamp[p];
-        if (t == 0) {
-          continue;
-        }
-        if (comma) {
-          out.print(",");
-        }
-        out.print("{\"query\":");
-        out.print(query);
-        out.print(",\"fetch\":");
-        out.print(fetch);
-        out.print(",\"mutate\":");
-        out.print(mutate);
-        out.print(",\"except\":");
-        out.print(except);
-        out.print(",\"recordTime\":");
-        out.print(t);
-        out.print('}');
-        comma = true;
-      }
-      out.print("]}");
-    }
-  }
-  
-  public void writeGraph2Json(PrintWriter out) {
-    synchronized (this) {
-      out.print("{\"labels\":[");
-      out.print("{\"name\":\"fetchRecord\",\"style\":{\"stroke\":\"Black\"}},");
-      out.print("{\"name\":\"mutateRecord\",\"style\":{\"stroke\":\"Orange\"}}");
-      out.print("],\"data\":[");
-      int p = position;
-      boolean comma = false;
-      for (int i = 0; i < sampleSize; i++, p++) {
-        if (p >= sampleSize) {
-          p = 0;
-        }
-        double fetch = _fetchRecordRate[p];
-        double mutate = _mutateRecordRate[p];
-        long t = timestamp[p];
-        if (t == 0) {
-          continue;
-        }
-        if (comma) {
-          out.print(",");
-        }
-        out.print("{\"fetchRecord\":");
-        out.print(fetch);
-        out.print(",\"mutateRecord\":");
-        out.print(mutate);
-        out.print(",\"recordTime\":");
-        out.print(t);
-        out.print('}');
-        comma = true;
-      }
-      out.print("]}");
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b49f6553/src/blur-gui/src/main/java/org/apache/blur/gui/SystemLoadMetrics.java
----------------------------------------------------------------------
diff --git a/src/blur-gui/src/main/java/org/apache/blur/gui/SystemLoadMetrics.java b/src/blur-gui/src/main/java/org/apache/blur/gui/SystemLoadMetrics.java
deleted file mode 100644
index 5b34a7c..0000000
--- a/src/blur-gui/src/main/java/org/apache/blur/gui/SystemLoadMetrics.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.apache.blur.gui;
-
-import java.io.PrintWriter;
-import java.lang.management.ManagementFactory;
-import java.lang.management.OperatingSystemMXBean;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.concurrent.TimeUnit;
-
-public class SystemLoadMetrics extends TimerTask {
-
-  private final int sampleSize = (int) TimeUnit.MINUTES.toSeconds(10);
-  private final Timer timer;
-  private final long period = TimeUnit.SECONDS.toMillis(1);
-  private final double[] systemLoadAverageHistory = new double[sampleSize];
-  private final long[] timestamp = new long[sampleSize];
-  private volatile static SystemLoadMetrics instance;
-  private volatile int position = 0;
-
-  public static synchronized SystemLoadMetrics getInstance() {
-    if (instance == null) {
-      instance = new SystemLoadMetrics();
-    }
-    return instance;
-  }
-
-  private SystemLoadMetrics() {
-    timer = new Timer("SystemLoadMetrics", true);
-    timer.scheduleAtFixedRate(this, period, period);
-  }
-
-  @Override
-  public void run() {
-    synchronized (this) {
-      if (position >= sampleSize) {
-        position = 0;
-      }
-      OperatingSystemMXBean operatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean();
-      systemLoadAverageHistory[position] = operatingSystemMXBean.getSystemLoadAverage();
-      timestamp[position] = System.currentTimeMillis();
-      position++;
-    }
-  }
-
-  public void writeJson(PrintWriter out) {
-    synchronized (this) {
-      out.print("{\"labels\":[{\"name\":\"load\",\"style\":{\"stroke\":\"Red\"}}],\"data\":[");
-      int p = position;
-      boolean comma = false;
-      for (int i = 0; i < sampleSize; i++, p++) {
-        if (p >= sampleSize) {
-          p = 0;
-        }
-        double load = systemLoadAverageHistory[p];
-        long t = timestamp[p];
-        if (t == 0) {
-          continue;
-        }
-        if (comma) {
-          out.print(",");
-        }
-        out.print("{\"load\":");
-        out.print(load);
-        out.print(",\"recordTime\":");
-        out.print(t);
-        out.print('}');
-        comma = true;
-      }
-      out.print("]}");
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b49f6553/src/blur-gui/src/main/webapp/footer.jsp
----------------------------------------------------------------------
diff --git a/src/blur-gui/src/main/webapp/footer.jsp b/src/blur-gui/src/main/webapp/footer.jsp
index 7d67d00..dd36b6c 100644
--- a/src/blur-gui/src/main/webapp/footer.jsp
+++ b/src/blur-gui/src/main/webapp/footer.jsp
@@ -18,4 +18,4 @@
  */
 %>
 	<br/>
-	<a href="index.html">home</a> | <a href="logs">logs</a> | <a
href="livemetrics.jsp">live status</a> | <a href="metrics.jsp">metrics</a>
<a href="metrics" title="Great with plugins like jsonView">(raw)</a>
\ No newline at end of file
+	<a href="index.html">home</a> | <a href="logs">logs</a> | <a
href="metrics.jsp">metrics</a> <a href="metrics" title="Great with plugins like
jsonView">(raw)</a>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b49f6553/src/blur-gui/src/main/webapp/metrics.jsp
----------------------------------------------------------------------
diff --git a/src/blur-gui/src/main/webapp/metrics.jsp b/src/blur-gui/src/main/webapp/metrics.jsp
index f8ee025..515a059 100644
--- a/src/blur-gui/src/main/webapp/metrics.jsp
+++ b/src/blur-gui/src/main/webapp/metrics.jsp
@@ -17,123 +17,143 @@
  * limitations under the License.
  */
 %>
-<%@page import="java.text.DecimalFormat"%>
-<%@page import="java.text.NumberFormat"%>
-<%@ page contentType="text/html; charset=UTF-8" isThreadSafe="false"
-	import="javax.servlet.*" import="javax.servlet.http.*"
-	import="java.io.*" import="java.util.*" import="java.text.DateFormat"
-	import="java.lang.Math" import="java.net.URLEncoder"
-	import="org.apache.blur.thrift.*"
-	import="org.apache.blur.thrift.generated.*"
-	import="org.apache.blur.thrift.generated.Blur.*"%>
-<%@ include file="functions.jsp"%>
+
 <%
 	String hostName = request.getServerName() + ":" + System.getProperty("blur.gui.servicing.port");
 %>
 <html>
-<head>
-<title>Metrics
-</title>
-
-<link href="style.css" rel="stylesheet" type="text/css" />
-
-</head>
-
-<script src="d3.v2.js"></script>
-<body>
-	<script>
-		//decimal formatter
-		var df = d3.format(",");
-		var df1dp = d3.format("3,.1f");
-		var methodCalls;
+  <head>
+    <title>Metrics</title>
+    <link href="style.css" rel="stylesheet" type="text/css" />
+  </head>
+  <script src="js/jquery-1.9.1.min.js"></script>
+  
+  <script type="text/javascript">
+    $(function() {
+        $.getJSON('metrics', function(data) {
+            $("#jvm").append(tree(data["jvm"]));
+            
+            var ignoreColumns = ["Operation", "Buffer Type", "Property"];
+            var thriftCallsInfoColumns = ["Operation", "count", "max", "mean", "median",
"min", "p75", "p95", "p98", "p99", "p999", "std_dev"];
+            var thriftCallsTable = constructTable(data["org.apache.blur.Blur.Thrift Calls
in �s"], thriftCallsInfoColumns, ignoreColumns);
+            $("#thrift-calls").append(thriftCallsTable);
+            
+            var luceneInternalBuffersColumns = ["Buffer Type", "count", "m1", "m5", "m15",
"mean", "type", "unit"];
+            var thriftCallsTable = constructTable(data["org.apache.blur.Lucene.Internal Buffers"],
luceneInternalBuffersColumns, ignoreColumns);
+            $("#lucene-internal-buffers").append(thriftCallsTable);
+            
+            var blurDefaultColumns = ["Property", "type", "value"];
+            var blurDefaultTable = constructTable(data["org.apache.blur.Blur.default"], blurDefaultColumns,
ignoreColumns);
+            $("#blur-default").append(blurDefaultTable);
+            
+            var blurLuceneTable = constructTable(data["org.apache.blur.Lucene"], blurDefaultColumns,
ignoreColumns);
+            $("#blur-lucene").append(blurLuceneTable);
+            
+            var blurColumns = ["Operation", "count", "m1", "m5", "m15", "mean", "type", "unit"];
+            var blurTable = constructTable(data["org.apache.blur.Blur"], blurColumns, ignoreColumns);
+            $("#blur").append(blurTable);
+            
+            $("#blur-fetchtimer").append(tree(data["org.apache.blur.Blur"]["Fetch Timer"]));
+        }); 
+    });
+    
+    /*
+     * Builds and returns a UL/LI tree recirsively from the json data provided
+     */
+    function tree(data) {    
+        if (typeof(data) == 'object') {        
+            var ul = $('<ul>');
+            for (var i in data) {            
+                ul.append($('<li>').text(i).append(tree(data[i])));         
+            }        
+            return ul;
+        } else {       
+            var textNode = document.createTextNode(' : ' + data);
+            return textNode;
+        }
+    }
 
+    function constructTable(data, columns, ignoreColumns) {
+    	var table = $("<table>");
+		table.attr("border", "1px solid black");
+		table.attr("border-collapse", "collapse");
+		var thead = $("<thead>");
+		var tbody = $("<tbody>");
+		table.append(thead),
+        table.append(tbody);
 		
-		//basic printout
-		d3.json("metrics", function(json) {
-			
-			methodCalls = json["methodCalls"];
-			delete json["methodCalls"];
-			
-			var topLevelMetrics = d3.entries(json);
-			
-		    var columns = ["stat", "value"];
-
-		    var table = d3.select("#leftTD").append("table"),
-		        thead = table.append("thead"),
-		        tbody = table.append("tbody");
-
-		    // append the header row
-		    thead.append("tr")
-		        .selectAll("th")
-		        .data(columns)
-		        .enter()
-		        .append("th")
-		            .text(function(column) { return column; })
-		            .style("text-align", function(d) { return "left"});
+		var headrow = $("<tr>");
+		for (var i in columns) {
+			headrow.append($("<th>").text(columns[i]).css("text-align", "left").css("border",
"1px solid black"));
+		}
+		thead.append(headrow);
+	    
+		$.each(data, function(k, v) {
+			var ignoreKey = false;
+		    var tr = $("<tr>");
+		    tr.append($("<td>").text(camelCaseToNormal(k)).css("border", "1px solid black"));
+		    for (var i in columns) {
+		    	if ($.inArray(columns[i], ignoreColumns) == -1) {
+		    		
+		    		if (v[columns[i]] == undefined) {
+		    			ignoreKey = true;
+		    		} else {
+		    			// fetch the value of the appropriate column
+			    		var td = $("<td>");
+		    		    td.text(v[columns[i]]);
+		    		    td.css("border", "1px solid black");
+		    	        tr.append(td);
+		    		}
+		    	}
+		    }
 		    
-		    // create a row for each object in the data
-		    var rows = tbody.selectAll("tr")
-		        .data(topLevelMetrics)
-		        .enter()
-		        .append("tr")
-		        .style("background-color", function(d,i) { return i % 2 ? "#eee" : "#ddd"; });
-
-		    // create a cell in each row for each column
-		    var cells = rows.selectAll("td")
-		        .data(function(row) {
-		        	return d3.entries(row);
-		        })
-		        .enter()
-		        .append("td")
-		            .text(function(d) { return d.value; });
-			
-		    var nsToS = 1000000000;
-		    
-			//alert(json);
-			arr = [];
-			arr[0] = json;
-			
-			var rTable = d3.select("#rightTD").append("table"),
-				rHead = rTable.append("thead"),
-				rBody = rTable.append("tbody");
-
-	        rHead.append("tr")
-		        .selectAll("th")
-		        .data(["MethodCall","rate (s)","invokes","times (ns)"])
-		        .enter()
-		        .append("th")
-		        .text(function(column) { return column; })
-		        .style("text-align", function(d) { return "left"});
-	        
-		    var rrows = rBody.selectAll("tr")
-		            .data(d3.keys(methodCalls))
-		            .enter()
-		            .append("tr")
-		            .style("background-color", function(d,i) { return i % 2 ? "#eee" : "#ddd";
});
-		    
-		    rrows.selectAll("td")
-					.data(function(d,i) { return [d, 
-					                            df1dp(methodCalls[d].invokes/(methodCalls[d].times/nsToS)),
-					                            df(methodCalls[d].invokes),
-					                            methodCalls[d].times] } )
-					.enter()
-					.append("td")
-					.text(function(d) { return d; });
+		    if (!ignoreKey) {
+		        tbody.append(tr);
+		    }
 		});
-	</script>
-	<h1>
-		Blur <%=System.getProperty("blur.gui.mode") %> '<%=hostName%>'
-	</h1>
-	<br />
-	<table>
-	<tr>
-	<td width="400" id="leftTD" valign="top"></td>
-	<td width="400" id="rightTD" valign="top"></td>
-	</tr>
-	</table>
-<div>
-</div>
-<%@ include file="footer.jsp" %>
-</body>
-</html>
+		
+		return table;
+    }
+    
+    function camelCaseToNormal(text) {
+    	return text.replace(/([A-Z])/g, ' $1').replace(/^./, function(str){ return str.toUpperCase();
})
+    }
+
+  </script>
+  
+  <body style="padding:20px;">
+    <div id="header">
+      <h1>Blur <%=System.getProperty("blur.gui.mode") %> '<%=hostName%>'</h1>
+    </div>
+	
+	<div class="container">
+      <div class="content">
+        <div id="jvm"><h2>JVM Properties</h2></div>
+      </div>
+    
+      <div class="content">
+        <div id="thrift-calls"><h2>Thrift Calls</h2></div>
+      </div>
+    </div>
+    
+    <div class="container" style="clear:both;">
+      <div id="blur" class="content" style="width:1300px;"><h2>Blur</h2></div>
+    </div> 
+    
+    <div class="container" style="clear:both;">
+      <div id="lucene-internal-buffers" class="content" style="width:1300px;"><h2>Lucene
Internal Buffers</h2></div>
+    </div>  
 
+    <div class="container" style="clear:both;">
+      <div id="blur-default" class="content" style="width:400px;"><h2>Blur Default</h2></div>
+      <div id="blur-lucene"  class="content" style="width:400px;"><h2>Lucene</h2></div>
+      <div id="blur-fetchtimer" class="content" style="width:300px;"><h2>Blur
Fetch Timer</h2></div>
+    </div>  
+    
+      <div id="footer">
+        <%@ include file="footer.jsp" %>
+      </div>
+    
+	
+  </body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b49f6553/src/blur-gui/src/main/webapp/style.css
----------------------------------------------------------------------
diff --git a/src/blur-gui/src/main/webapp/style.css b/src/blur-gui/src/main/webapp/style.css
index 2e08732..bfecdf1 100644
--- a/src/blur-gui/src/main/webapp/style.css
+++ b/src/blur-gui/src/main/webapp/style.css
@@ -71,4 +71,19 @@ path {
   fill:none;
   stroke:black;
   stroke-width:2px;
+}
+
+.container {
+    width:1300px;
+    margin:20px 0;
+    padding: 20px;
+}
+
+.content {
+    float:left;
+    width:600px;
+}
+
+#footer {
+    clear:both;
 }
\ No newline at end of file


Mime
View raw message