hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [1/3] hbase git commit: HBASE-15586 Unify human readable numbers in the web UI
Date Fri, 08 Apr 2016 00:13:23 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 b17350210 -> d94c18a0e
  refs/heads/branch-1.3 acc5d262a -> 2fc7c8bbc
  refs/heads/master a146a71a3 -> 2dcd08bc3


HBASE-15586 Unify human readable numbers in the web UI


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2dcd08bc
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2dcd08bc
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2dcd08bc

Branch: refs/heads/master
Commit: 2dcd08bc3d8ab2f26da85128102926c68a95186f
Parents: a146a71
Author: Enis Soztutar <enis@apache.org>
Authored: Thu Apr 7 17:07:33 2016 -0700
Committer: Enis Soztutar <enis@apache.org>
Committed: Thu Apr 7 17:07:33 2016 -0700

----------------------------------------------------------------------
 .../tmpl/master/RegionServerListTmpl.jamon      | 22 ++++++++++-----
 .../tmpl/regionserver/BlockCacheTmpl.jamon      | 12 ++++----
 .../tmpl/regionserver/RegionListTmpl.jamon      | 16 +++++++----
 .../tmpl/regionserver/ServerMetricsTmpl.jamon   | 29 ++++++++++----------
 4 files changed, 48 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/2dcd08bc/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon
index c051743..a62d5eb 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon
@@ -29,6 +29,7 @@ HMaster master;
         org.apache.hadoop.hbase.ServerLoad;
         org.apache.hadoop.hbase.ServerName;
         org.apache.hadoop.hbase.util.VersionInfo;
+        org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
 </%import>
 
 
@@ -148,9 +149,12 @@ for (ServerName serverName: serverNames) {
 </%java>
 <tr>
     <td><& serverNameLink; serverName=serverName; serverLoad = sl; &></td>
-    <td><% sl.getUsedHeapMB() %>m</td>
-    <td><% sl.getMaxHeapMB() %>m</td>
-    <td><% sl.getMemstoreSizeInMB() %>m</td>
+    <td><% TraditionalBinaryPrefix.long2String(sl.getUsedHeapMB()
+      * TraditionalBinaryPrefix.MEGA.value, "B", 1) %></td>
+    <td><% TraditionalBinaryPrefix.long2String(sl.getMaxHeapMB()
+      * TraditionalBinaryPrefix.MEGA.value, "B", 1) %></td>
+    <td><% TraditionalBinaryPrefix.long2String(sl.getMemstoreSizeInMB()
+      * TraditionalBinaryPrefix.MEGA.value, "B", 1) %></td>
 
 </tr>
 <%java>
@@ -226,10 +230,14 @@ if (sl != null) {
 <td><& serverNameLink; serverName=serverName; serverLoad = sl; &></td>
 <td><% sl.getStores() %></td>
 <td><% sl.getStorefiles() %></td>
-<td><% sl.getStoreUncompressedSizeMB() %>m</td>
-<td><% sl.getStorefileSizeInMB() %>mb</td>
-<td><% sl.getTotalStaticIndexSizeKB() %>k</td>
-<td><% sl.getTotalStaticBloomSizeKB() %>k</td>
+<td><% TraditionalBinaryPrefix.long2String(
+  sl.getStoreUncompressedSizeMB() * TraditionalBinaryPrefix.MEGA.value, "B", 1) %></td>
+<td><% TraditionalBinaryPrefix.long2String(sl.getStorefileSizeInMB()
+  * TraditionalBinaryPrefix.MEGA.value, "B", 1) %></td>
+<td><% TraditionalBinaryPrefix.long2String(sl.getTotalStaticIndexSizeKB()
+  * TraditionalBinaryPrefix.KILO.value, "B", 1) %></td>
+<td><% TraditionalBinaryPrefix.long2String(sl.getTotalStaticBloomSizeKB()
+  * TraditionalBinaryPrefix.KILO.value, "B", 1) %></td>
 </tr>
 <%java>
         }  else {

http://git-wip-us.apache.org/repos/asf/hbase/blob/2dcd08bc/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
index 3dcd5e2..1277acc 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/BlockCacheTmpl.jamon
@@ -45,7 +45,7 @@ org.apache.hadoop.hbase.io.hfile.bucket.BucketCacheStats;
 org.apache.hadoop.hbase.io.hfile.bucket.BucketCache;
 org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator;
 org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocator.Bucket;
-org.apache.hadoop.util.StringUtils;
+org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
 </%import>
 <div class="tabbable">
     <ul class="nav nav-pills">
@@ -245,12 +245,14 @@ org.apache.hadoop.util.StringUtils;
     </tr>
     <tr>
         <td>Size</td>
-        <td><% StringUtils.humanReadableInt(cacheConfig.getBlockCache().getCurrentSize())
%></td>
+        <td><% TraditionalBinaryPrefix.long2String(cacheConfig.getBlockCache().getCurrentSize(),
+            "B", 1) %></td>
         <td>Current size of block cache in use (bytes)</td>
     </tr>
     <tr>
         <td>Free</td>
-        <td><% StringUtils.humanReadableInt(cacheConfig.getBlockCache().getFreeSize())
%></td>
+        <td><% TraditionalBinaryPrefix.long2String(cacheConfig.getBlockCache().getFreeSize(),
+            "B", 1) %></td>
         <td>The total free memory currently available to store more cache entries (bytes)</td>
     </tr>
     <tr>
@@ -337,13 +339,13 @@ are combined counts. Request count is sum of hits and misses.</p>
 </%if>
     <tr>
         <td>Size</td>
-        <td><% StringUtils.humanReadableInt(cbsbf.getSize()) %></td>
+        <td><% TraditionalBinaryPrefix.long2String(cbsbf.getSize(), "B", 1) %></td>
         <td>Size of Blocks</td>
     </tr>
 <%if !bucketCache %>
     <tr>
         <td>Size</td>
-        <td><% StringUtils.humanReadableInt(cbsbf.getDataSize()) %></td>
+        <td><% TraditionalBinaryPrefix.long2String(cbsbf.getDataSize(), "B", 1)
%></td>
         <td>Size of DATA Blocks</td>
     </tr>
 </%if> 

http://git-wip-us.apache.org/repos/asf/hbase/blob/2dcd08bc/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
index cefd476..6261755 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
@@ -33,6 +33,7 @@
         org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionLoad;
         org.apache.hadoop.hbase.client.RegionReplicaUtil;
         org.apache.hadoop.hbase.regionserver.MetricsRegionWrapper;
+        org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
 </%import>
 <%if (onlineRegions != null && onlineRegions.size() > 0) %>
 
@@ -170,10 +171,14 @@
             <%if load != null %>
             <td><% load.getStores() %></td>
             <td><% load.getStorefiles() %></td>
-            <td><% load.getStoreUncompressedSizeMB() %>m</td>
-            <td><% load.getStorefileSizeMB() %>m</td>
-            <td><% load.getTotalStaticIndexSizeKB() %>k</td>
-            <td><% load.getTotalStaticBloomSizeKB() %>k</td>
+            <td><% TraditionalBinaryPrefix.long2String(load.getStoreUncompressedSizeMB()
+                * TraditionalBinaryPrefix.MEGA.value, "B", 1)%></td>
+            <td><% TraditionalBinaryPrefix.long2String(load.getStorefileSizeMB()
+                * TraditionalBinaryPrefix.MEGA.value, "B", 1) %></td>
+            <td><% TraditionalBinaryPrefix.long2String(load.getTotalStaticIndexSizeKB()
+                * TraditionalBinaryPrefix.KILO.value, "B", 1) %></td>
+            <td><% TraditionalBinaryPrefix.long2String(load.getTotalStaticBloomSizeKB()
+                * TraditionalBinaryPrefix.KILO.value, "B", 1) %></td>
             <td><% load.getDataLocality() %></td>
             </%if>
         </tr>
@@ -238,7 +243,8 @@
         </%java>
             <td><a href="region.jsp?name=<% r.getEncodedName() %>"><%
displayName %></a></td>
             <%if load != null %>
-            <td><% load.getMemstoreSizeMB() %>m</td>
+            <td><% TraditionalBinaryPrefix.long2String(
+                load.getMemstoreSizeMB() * TraditionalBinaryPrefix.MEGA.value, "B", 1) %></td>
             </%if>
         </tr>
         </%for>

http://git-wip-us.apache.org/repos/asf/hbase/blob/2dcd08bc/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
index de2aeca..f5aa478 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon
@@ -33,7 +33,7 @@ org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 org.apache.hadoop.hbase.protobuf.generated.AdminProtos.ServerInfo;
 org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionLoad;
 org.apache.hadoop.hbase.util.DirectMemoryUtils;
-org.apache.hadoop.util.StringUtils;
+org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix;
 java.lang.management.ManagementFactory;
 </%import>
 <div class="tabbable">
@@ -106,18 +106,20 @@ MetricsRegionServerWrapper mWrap;
 </tr>
 <tr>
     <td>
-        <% StringUtils.humanReadableInt(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed())
%>
+        <% TraditionalBinaryPrefix.long2String(
+            ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed(), "B", 1) %>
     </td>
     <td>
-        <% StringUtils.humanReadableInt(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax())
%>
+        <% TraditionalBinaryPrefix.long2String(
+            ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getMax(), "B", 1) %>
     </td>
     <td>
-        <% StringUtils.humanReadableInt(DirectMemoryUtils.getDirectMemoryUsage()) %>
+        <% TraditionalBinaryPrefix.long2String(DirectMemoryUtils.getDirectMemoryUsage(),
"B", 1) %>
     </td>
     <td>
-        <% StringUtils.humanReadableInt(DirectMemoryUtils.getDirectMemorySize()) %>
+        <% TraditionalBinaryPrefix.long2String(DirectMemoryUtils.getDirectMemorySize(),
"B", 1) %>
     </td>
-    <td><% StringUtils.humanReadableInt(mWrap.getMemstoreSize()) %></td>
+    <td><% TraditionalBinaryPrefix.long2String(mWrap.getMemstoreSize(), "B", 1)
%></td>
 </tr>
 </table>
 </%def>
@@ -135,7 +137,7 @@ MetricsRegionServerWrapper mWrap;
 </tr>
 <tr>
     <td><% mWrap.getNumWALFiles() %></td>
-    <td><% mWrap.getWALFileSize() %></td>
+    <td><% TraditionalBinaryPrefix.long2String(mWrap.getWALFileSize(), "B", 1) %></td>
 </tr>
 </table>
 </%def>
@@ -154,11 +156,11 @@ MetricsRegionServerWrapper mWrap;
     <th>Bloom Size (bytes)</th>
 </tr>
 <tr>
-    <td><% StringUtils.humanReadableInt(mWrap.getNumStores()) %></td>
-    <td><% StringUtils.humanReadableInt(mWrap.getNumStoreFiles()) %></td>
-    <td><% StringUtils.humanReadableInt(mWrap.getStoreFileIndexSize()) %></td>
-    <td><% StringUtils.humanReadableInt(mWrap.getTotalStaticIndexSize()) %></td>
-    <td><% StringUtils.humanReadableInt(mWrap.getTotalStaticBloomSize()) %></td>
+    <td><% mWrap.getNumStores() %></td>
+    <td><% mWrap.getNumStoreFiles() %></td>
+    <td><% TraditionalBinaryPrefix.long2String(mWrap.getStoreFileIndexSize(), "B",
1) %></td>
+    <td><% TraditionalBinaryPrefix.long2String(mWrap.getTotalStaticIndexSize(),
"B", 1) %></td>
+    <td><% TraditionalBinaryPrefix.long2String(mWrap.getTotalStaticBloomSize(),
"B", 1) %></td>
 </tr>
 </table>
 </%def>
@@ -199,8 +201,7 @@ MetricsHBaseServerWrapper mServerWrap;
 <tr>
     <td><% mWrap.getCompactionQueueSize() %></td>
     <td><% mWrap.getFlushQueueSize() %></td>
-    <td><% StringUtils.TraditionalBinaryPrefix.long2String(mServerWrap.getTotalQueueSize(),
-      "", 1) %></td>
+    <td><% TraditionalBinaryPrefix.long2String(mServerWrap.getTotalQueueSize(),
"B", 1) %></td>
 </tr>
 </table>
 </%def>


Mime
View raw message