Small fixes in the webapp.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/011cc875 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/011cc875 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/011cc875 Branch: refs/heads/master Commit: 011cc875eba33f9b9c987a9d2b1a451126a403dd Parents: b0eda0d Author: Aaron McCurry <[email protected]> Authored: Mon Sep 10 22:52:31 2012 -0400 Committer: Aaron McCurry <[email protected]> Committed: Mon Sep 10 22:52:31 2012 -0400 ---------------------------------------------------------------------- src/blur-gui/src/main/webapp/footer.jsp | 2 +- src/blur-gui/src/main/webapp/livemetrics.jsp | 59 +++++++++++---------- src/blur-gui/src/main/webapp/style.css | 21 +++++++ src/blur-gui/src/main/webapp/table.jsp | 26 +++++---- 4 files changed, 66 insertions(+), 42 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/011cc875/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 dd36b6c..7d67d00 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="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="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 http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/011cc875/src/blur-gui/src/main/webapp/livemetrics.jsp ---------------------------------------------------------------------- diff --git a/src/blur-gui/src/main/webapp/livemetrics.jsp b/src/blur-gui/src/main/webapp/livemetrics.jsp index b91c1d1..45d636a 100644 --- a/src/blur-gui/src/main/webapp/livemetrics.jsp +++ b/src/blur-gui/src/main/webapp/livemetrics.jsp @@ -17,32 +17,27 @@ * limitations under the License. */ %> -<!DOCTYPE html> -<meta charset="utf-8"></meta> -<style> -.axis path { - fill:none; - stroke: black; -} - -.tick { - fill:none; - stroke:black; -} - -.axis { - font-family: arial; - font-size:0.6em; -} - -path { - fill:none; - stroke:black; - stroke-width:2px; -} -</style> -<body> +<%@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> function draw(uri, id, data, margin, width, height, xLabel, yLabel, labels) { "use strict"; @@ -98,14 +93,20 @@ function drawGraphs(uri, margin, width, height) { }, 1000); } -var margin = 50, width = 600, height = 250; +var margin = 50, width = 450, height = 220; drawGraphs("/livemetrics", margin, width, height) </script> - +<h1> + Blur <%=System.getProperty("blur.gui.mode") %> '<%=hostName%>' +</h1> +<h3>JVM Heap / Committed Heap</h3> <div id="jvm"></div> +<h3>Blur Queries / Fetches / Mutates</h3> <div id="blur"></div> +<h3>System Load</h3> <div id="system"></div> - -</body> \ No newline at end of file +<%@ include file="footer.jsp" %> +</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/011cc875/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 cda4fb7..2e08732 100644 --- a/src/blur-gui/src/main/webapp/style.css +++ b/src/blur-gui/src/main/webapp/style.css @@ -50,4 +50,25 @@ td { padding: 10px 5px 0px 5px; font-family: Helvetica; background-color: #DDDDDD; +} + +.axis path { + fill:none; + stroke: black; +} + +.tick { + fill:none; + stroke:black; +} + +.axis { + font-family: arial; + font-size:0.6em; +} + +path { + fill:none; + stroke:black; + stroke-width:2px; } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/011cc875/src/blur-gui/src/main/webapp/table.jsp ---------------------------------------------------------------------- diff --git a/src/blur-gui/src/main/webapp/table.jsp b/src/blur-gui/src/main/webapp/table.jsp index 72bce7b..a43f0d8 100644 --- a/src/blur-gui/src/main/webapp/table.jsp +++ b/src/blur-gui/src/main/webapp/table.jsp @@ -81,23 +81,25 @@ public String getAD(Iface client, String tableName) throws Exception { String ret = ""; - TableDescriptor td = client.describe(tableName); AnalyzerDefinition ad = td.analyzerDefinition; Map<String, ColumnFamilyDefinition> cfds = ad.columnFamilyDefinitions; - for (String cf : cfds.keySet()) { - ColumnFamilyDefinition cfd = cfds.get(cf); - if (cfd.defaultDefinition != null) - ret += row(cf, "default", - cfd.defaultDefinition.analyzerClassName); - else - ret += row(cf, "default", "none set"); - for (String col : cfd.columnDefinitions.keySet()) { - ret += row("", col, - cfd.columnDefinitions.get(col).analyzerClassName); + if (cfds != null) { + for (String cf : cfds.keySet()) { + ColumnFamilyDefinition cfd = cfds.get(cf); + if (cfd.defaultDefinition != null) { + ret += row(cf, "default", cfd.defaultDefinition.analyzerClassName); + } + else { + ret += row(cf, "default", "none set"); + } + if (cfd.columnDefinitions != null) { + for (String col : cfd.columnDefinitions.keySet()) { + ret += row("", col, cfd.columnDefinitions.get(col).analyzerClassName); + } + } } } - return ret; }%> <%
