modded startup script for blur, need to package jsp's into the jar next

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

Branch: refs/heads/master
Commit: 7237024223e1ffacfdeb78a62a0abfa3173ad6fd
Parents: ed75462
Author: gbarton <[email protected]>
Authored: Mon Aug 20 09:23:08 2012 -0400
Committer: gbarton <[email protected]>
Committed: Mon Aug 20 09:23:08 2012 -0400

----------------------------------------------------------------------
 bin/blur-config.sh                                 |    4 +
 .../src/main/webapps/controller/metrics.jsp        |   61 ++++++++++++---
 2 files changed, 53 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/72370242/bin/blur-config.sh
----------------------------------------------------------------------
diff --git a/bin/blur-config.sh b/bin/blur-config.sh
index 71929d6..664d1f3 100755
--- a/bin/blur-config.sh
+++ b/bin/blur-config.sh
@@ -77,6 +77,10 @@ for f in $BLUR_HOME/lib/*.jar; do
   BLUR_CLASSPATH=${BLUR_CLASSPATH}:$f;
 done
 
+for f in $HADOOP_HOME/lib/jsp-2.1/*.jar; do
+ BLUR_CLASSPATH=${BLUR_CLASSPATH}:$f;
+done
+
 export BLUR_CLASSPATH
 
 # setup 'java.library.path' for native-hadoop code if necessary

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/72370242/src/blur-gui/src/main/webapps/controller/metrics.jsp
----------------------------------------------------------------------
diff --git a/src/blur-gui/src/main/webapps/controller/metrics.jsp 
b/src/blur-gui/src/main/webapps/controller/metrics.jsp
index 4bd6da8..1e4dfdb 100644
--- a/src/blur-gui/src/main/webapps/controller/metrics.jsp
+++ b/src/blur-gui/src/main/webapps/controller/metrics.jsp
@@ -26,37 +26,74 @@
                //decimal formatter
                var df = d3.format("4d");
 
+               
                //basic printout
                d3.json("metrics", function(json) {
+                       
+                       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"});
+                   
+                   // 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; });
+
+
+                       
+                       
                        //alert(json);
                        arr = [];
                        arr[0] = json;
                        //select obj and bind data
-                       d3.select("div").selectAll("ul")
+                       d3.select("#rightTD").selectAll("ul")
                                .data(arr)
                                .enter().append("ul")
                                .text("Metrics")
                                .selectAll("li")
                                .data(function(d) {
-                                       var map = [];
-                                       var i = 0;
-                                       for(var x in d) {
-                                               var obj = {};
-                                               obj.name = x;
-                                               obj.value = d[x];
-                                               map[i++] = obj;
-                                       }
-                                       return map})
+                                       return d3.entries(d);})
                                        .enter()
                                        .append("li")
-                                       .text(function(d) { return d.name + " " 
+ d.value })
-                                       .style("background-color", 
function(d,i) { return i % 2 ? "#eee" : "#ddd"; });
+                                       .text(function(d) { return d.key + " " 
+ d.value })
+                                       .style("background-color", 
function(d,i) { return i % 2 ? "#eee" : "#ddd"; })
+                                       .attr("id",function(d) { return d.key; 
});
                });
        </script>
        <h1>
                Blur <%=System.getProperty("blur.gui.mode") %> '<%=hostName%>'
        </h1>
        <br />
+       <table>
+       <tr>
+       <td width="400" id="leftTD"></td>
+       <td width="400" id="rightTD"></td>
+       </tr>
+       </table>
 <div>
 </div>
 <%@ include file="footer.jsp" %>

Reply via email to