more stats added to table page, methodcalls displaying nicely in metrics page
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/d5ab56be Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/d5ab56be Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/d5ab56be Branch: refs/heads/master Commit: d5ab56be13f44bed363a4f6cad738673bcded60f Parents: c7d5011 Author: gbarton <[email protected]> Authored: Fri Aug 24 01:00:27 2012 -0400 Committer: gbarton <[email protected]> Committed: Fri Aug 24 01:00:27 2012 -0400 ---------------------------------------------------------------------- .../src/main/webapps/controller/metrics.jsp | 43 ++++++++++----- src/blur-gui/src/main/webapps/controller/table.jsp | 6 ++ 2 files changed, 36 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d5ab56be/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 f8731ac..73d95b6 100644 --- a/src/blur-gui/src/main/webapps/controller/metrics.jsp +++ b/src/blur-gui/src/main/webapps/controller/metrics.jsp @@ -24,7 +24,8 @@ <body> <script> //decimal formatter - var df = d3.format("4d"); + var df = d3.format(","); + var df1dp = d3.format("3,.1f"); var methodCalls; @@ -67,22 +68,38 @@ .append("td") .text(function(d) { return d.value; }); + var nsToS = 1000000000; + //alert(json); arr = []; arr[0] = json; - //select obj and bind data - d3.select("#rightTD").selectAll("ul") - .data(d3.keys(methodCalls)) - .enter().append("ul") - .text(function(d) { return d;}) - .selectAll("li") - .data(function(d) { - return d3.entries(methodCalls[d]);}) + + 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("li") - .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; }); + .append("td") + .text(function(d) { return d; }); }); </script> <h1> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d5ab56be/src/blur-gui/src/main/webapps/controller/table.jsp ---------------------------------------------------------------------- diff --git a/src/blur-gui/src/main/webapps/controller/table.jsp b/src/blur-gui/src/main/webapps/controller/table.jsp index 498ad20..a8adbef 100644 --- a/src/blur-gui/src/main/webapps/controller/table.jsp +++ b/src/blur-gui/src/main/webapps/controller/table.jsp @@ -34,6 +34,12 @@ ret += row("Queries", ts.queries + ""); ret += row("Rows", ts.rowCount + ""); ret += row("Records", ts.recordCount + ""); + TableDescriptor td = client.describe(tableName); + ret += row("Block Caching", td.blockCaching + ""); + ret += row("Compression Block Size", td.compressionBlockSize + ""); + ret += row("Compression Class", td.compressionClass); + ret += row("Read Only", td.readOnly + ""); + return ret; }
