From 3bff065d34da5603d136a7c133f28eb9068cd626 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Tue, 27 Nov 2007 17:12:52 +0000 Subject: [PATCH] HADOOP-2257 Show a total of all requests and regions on the web ui git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk/src/contrib/hbase@598699 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../hbase/generated/master/master_jsp.java | 20 ++++++++++++++++--- src/webapps/master/master.jsp | 12 +++++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 779431e0e22..bc0fa6d5235 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -53,6 +53,7 @@ Trunk (unreleased changes) command. HADOOP-2262 HADOOP-2261 fail fast on non-existing table, change abort to function after commit even if commit was successful + HADOOP-2257 Show a total of all requests and regions on the web ui Release 0.15.1 Branch 0.15 diff --git a/src/java/org/apache/hadoop/hbase/generated/master/master_jsp.java b/src/java/org/apache/hadoop/hbase/generated/master/master_jsp.java index b4b4378d0c9..6b2f53e6aed 100644 --- a/src/java/org/apache/hadoop/hbase/generated/master/master_jsp.java +++ b/src/java/org/apache/hadoop/hbase/generated/master/master_jsp.java @@ -103,13 +103,21 @@ public final class master_jsp extends org.apache.jasper.runtime.HttpJspBase out.print(msg ); out.write("

\n\n

Region Servers

\n"); if (serverToServerInfos != null && serverToServerInfos.size() > 0) { - out.write("\n\n\n\n"); + out.write('\n'); + int totalRegions = 0; + int totalRequests = 0; + + out.write("\n\n
AddressStart CodeLoad
\n\n\n"); for (Map.Entry e: serverToServerInfos.entrySet()) { HServerInfo hsi = e.getValue(); String url = "http://" + hsi.getServerAddress().getBindAddress().toString() + ":" + hsi.getInfoPort() + "/"; String load = hsi.getLoad().toString(); + totalRegions += hsi.getLoad().getNumberOfRegions(); + totalRequests += hsi.getLoad().getNumberOfRequests(); long startCode = hsi.getStartCode(); String address = hsi.getServerAddress().toString(); @@ -122,9 +130,15 @@ public final class master_jsp extends org.apache.jasper.runtime.HttpJspBase out.print( startCode ); out.write("\n"); + out.write("\n"); } - out.write("\n
AddressStart CodeLoad
"); out.print( load ); - out.write("
\n

Load is requests per hbase.regionsserver.msginterval ("); + out.write("\nTotal: servers: "); + out.print( serverToServerInfos.size() ); + out.write(" requests: "); + out.print( totalRequests ); + out.write(" regions: "); + out.print( totalRegions ); + out.write("\n\n\n

Load is requests per hbase.regionsserver.msginterval ("); out.print(interval); out.write(" second(s)) and count of regions loaded

\n"); } diff --git a/src/webapps/master/master.jsp b/src/webapps/master/master.jsp index d9a19514c1d..269ddc83dd7 100644 --- a/src/webapps/master/master.jsp +++ b/src/webapps/master/master.jsp @@ -68,8 +68,12 @@

Region Servers

<% if (serverToServerInfos != null && serverToServerInfos.size() > 0) { %> +<% int totalRegions = 0; + int totalRequests = 0; +%> + - + <% for (Map.Entry e: serverToServerInfos.entrySet()) { HServerInfo hsi = e.getValue(); @@ -77,12 +81,16 @@ hsi.getServerAddress().getBindAddress().toString() + ":" + hsi.getInfoPort() + "/"; String load = hsi.getLoad().toString(); + totalRegions += hsi.getLoad().getNumberOfRegions(); + totalRequests += hsi.getLoad().getNumberOfRequests(); long startCode = hsi.getStartCode(); String address = hsi.getServerAddress().toString(); %> - + <% } %> +
AddressStart CodeLoad
>AddressStart CodeLoad
<%= address %><%= startCode %><%= load %>
<%= address %><%= startCode %><%= load %>
Total: servers: <%= serverToServerInfos.size() %> requests: <%= totalRequests %> regions: <%= totalRegions %>
+

Load is requests per hbase.regionsserver.msginterval (<%=interval%> second(s)) and count of regions loaded

<% } %>