commit a385e65c907d264a300d3bf61d78f2e092b828c9 Author: Todd Lipcon Date: Fri Apr 29 19:23:23 2011 -0700 HBASE-3839. Add monitoring of currently running tasks to the master and RS web UIs diff --git src/main/jamon/org/apache/hbase/tmpl/common/TaskMonitorTmpl.jamon src/main/jamon/org/apache/hbase/tmpl/common/TaskMonitorTmpl.jamon new file mode 100644 index 0000000..f96d4a2 --- /dev/null +++ src/main/jamon/org/apache/hbase/tmpl/common/TaskMonitorTmpl.jamon @@ -0,0 +1,59 @@ +<%doc> +Copyright 2011 The Apache Software Foundation + +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +<%import> +java.util.*; +org.apache.hadoop.hbase.monitoring.*; + +<%args> +TaskMonitor taskMonitor = TaskMonitor.get(); + +<%java> +long now = System.currentTimeMillis(); +List tasks = taskMonitor.getTasks(); +Collections.reverse(tasks); + + +

Currently running tasks

+ +<%if tasks.isEmpty()%> +No tasks currently running on this node. +<%else> + + + + + + + +<%for MonitoredTask task : tasks %> + + + + + + + +
DescriptionStatusAge
<% task.getDescription() %><% task.getStatus() %><% (int)((now - task.getStartTime())/1000) %>s + <%if task.getCompletionTimestamp() != -1%> + (Completed <% (now - task.getCompletionTimestamp())/1000 %>s ago) + +
+ + \ No newline at end of file diff --git src/main/jamon/org/apache/hbase/tmpl/master/MasterStatusTmpl.jamon src/main/jamon/org/apache/hbase/tmpl/master/MasterStatusTmpl.jamon index d5324c9..e5b1838 100644 --- src/main/jamon/org/apache/hbase/tmpl/master/MasterStatusTmpl.jamon +++ src/main/jamon/org/apache/hbase/tmpl/master/MasterStatusTmpl.jamon @@ -88,6 +88,9 @@ org.apache.hadoop.hbase.HTableDescriptor; Zookeeper Quorum<% master.getZooKeeperWatcher().getQuorum() %>Addresses of all registered ZK servers. For more, see zk dump. + +<& ../common/TaskMonitorTmpl &> + <%if (rootLocation != null) %> <& catalogTables &> diff --git src/main/jamon/org/apache/hbase/tmpl/regionserver/RSStatusTmpl.jamon src/main/jamon/org/apache/hbase/tmpl/regionserver/RSStatusTmpl.jamon index 617c8dc..04c33a0 100644 --- src/main/jamon/org/apache/hbase/tmpl/regionserver/RSStatusTmpl.jamon +++ src/main/jamon/org/apache/hbase/tmpl/regionserver/RSStatusTmpl.jamon @@ -68,6 +68,8 @@ org.apache.hadoop.hbase.HRegionInfo; Zookeeper Quorum<% regionServer.getZooKeeper().getQuorum() %>Addresses of all registered ZK servers +<& ../common/TaskMonitorTmpl &> +

Online Regions

<%if (onlineRegions != null && onlineRegions.size() > 0) %> diff --git src/main/resources/hbase-webapps/static/hbase.css src/main/resources/hbase-webapps/static/hbase.css index 1163fda..dadc0dc 100644 --- src/main/resources/hbase-webapps/static/hbase.css +++ src/main/resources/hbase-webapps/static/hbase.css @@ -17,3 +17,11 @@ div.warning { td.undeployed-region { background-color: #faa; } + +tr.task-monitor-COMPLETE td { + background-color: #afa; +} + +tr.task-monitor-ABORTED td { + background-color: #ffa; +}