[ 
https://issues.apache.org/jira/browse/HBASE-11062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16917316#comment-16917316
 ] 

Andrew Purtell commented on HBASE-11062:
----------------------------------------

Fixed the issue with the branch-1 backport, formatting is better. Was my error 
somewhere. 

I see a div by zero issue when using ClusterStatus instead of ClusterMetrics, 
maybe this minor change should be considered:
{code}
diff --git 
a/hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/mode/RequestCountPerSecond.java
 
b/hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/mode/RequestCountPerSecond.java
index 27625b9a33..5fd3453cf9 100644
--- 
a/hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/mode/RequestCountPerSecond.java
+++ 
b/hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/mode/RequestCountPerSecond.java
@@ -37,10 +37,12 @@ public class RequestCountPerSecond {
       previousReadRequestCount = readRequestCount;
       previousWriteRequestCount = writeRequestCount;
     } else if (previousLastReportTimestamp != lastReportTimestamp) {
-      readRequestCountPerSecond = (readRequestCount - 
previousReadRequestCount) /
-        ((lastReportTimestamp - previousLastReportTimestamp) / 1000);
-      writeRequestCountPerSecond = (writeRequestCount - 
previousWriteRequestCount) /
-        ((lastReportTimestamp - previousLastReportTimestamp) / 1000);
+      long delta = (lastReportTimestamp - previousLastReportTimestamp) / 1000;
+      if (delta < 1) {
+        delta = 1;
+      }
+      readRequestCountPerSecond = (readRequestCount - 
previousReadRequestCount) / delta;
+      writeRequestCountPerSecond = (writeRequestCount - 
previousWriteRequestCount) / delta;
 
       previousLastReportTimestamp = lastReportTimestamp;
       previousReadRequestCount = readRequestCount;
{code}

> hbtop
> -----
>
>                 Key: HBASE-11062
>                 URL: https://issues.apache.org/jira/browse/HBASE-11062
>             Project: HBase
>          Issue Type: New Feature
>          Components: hbtop
>            Reporter: Andrew Purtell
>            Assignee: Toshihiro Suzuki
>            Priority: Major
>
> A top-like monitor could be useful for testing, debugging, operations of 
> clusters of moderate size, and possibly for diagnosing issues in large 
> clusters.
> Consider a curses interface like the one presented by atop 
> (http://www.atoptool.nl/images/screenshots/genericw.png) - with aggregate 
> metrics collected over a monitoring interval in the upper portion of the 
> pane, and a listing of discrete measurements sorted and filtered by various 
> criteria in the bottom part of the pane. One might imagine a cluster overview 
> with cluster aggregate metrics above and a list of regionservers sorted by 
> utilization below; and a regionserver view with process metrics above and a 
> list of metrics by operation type below, or a list of client connections, or 
> a list of threads, sorted by utilization, throughput, or latency. 
> Generically 'htop' is taken but would be distinctive in the HBase context, a 
> utility org.apache.hadoop.hbase.HTop
> No need necessarily for a curses interface. Could be an external monitor with 
> a web front end as has been discussed before. I do like the idea of a process 
> that runs in a terminal because I interact with dev and test HBase clusters 
> exclusively by SSH. 
> UPDATE:
> The tool name is changed from htop to hbtop.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to