hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1156336 - in /hbase/trunk: ./ src/main/java/org/apache/hadoop/hbase/ src/main/java/org/apache/hadoop/hbase/io/hfile/ src/main/java/org/apache/hadoop/hbase/regionserver/metrics/
Date Wed, 10 Aug 2011 19:42:30 GMT
Author: stack
Date: Wed Aug 10 19:42:30 2011
New Revision: 1156336

URL: http://svn.apache.org/viewvc?rev=1156336&view=rev
Log:
HBASE-3807 Fix units in RS UI metrics

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/HServerLoad.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1156336&r1=1156335&r2=1156336&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Wed Aug 10 19:42:30 2011
@@ -370,6 +370,7 @@ Release 0.91.0 - Unreleased
    HBASE-3899  Add ability for delayed RPC calls to set return value
                immediately at call return. (Vlad Dogaru via todd)
    HBASE-4169  FSUtils LeaseRecovery for non HDFS FileSystems (Lohit Vijayarenu)
+   HBASE-3807  Fix units in RS UI metrics (subramanian raghunathan)
 
   TASKS
    HBASE-3559  Move report of split to master OFF the heartbeat channel

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/HServerLoad.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/HServerLoad.java?rev=1156336&r1=1156335&r2=1156336&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/HServerLoad.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/HServerLoad.java Wed Aug 10 19:42:30
2011
@@ -312,9 +312,9 @@ implements WritableComparable<HServerLoa
      */
     @Override
     public String toString() {
-      StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "stores",
+      StringBuilder sb = Strings.appendKeyValue(new StringBuilder(), "numberOfStores",
         Integer.valueOf(this.stores));
-      sb = Strings.appendKeyValue(sb, "storefiles",
+      sb = Strings.appendKeyValue(sb, "numberOfStorefiles",
         Integer.valueOf(this.storefiles));
       sb = Strings.appendKeyValue(sb, "storefileUncompressedSizeMB",
         Integer.valueOf(this.storeUncompressedSizeMB));
@@ -419,13 +419,13 @@ implements WritableComparable<HServerLoa
   public String toString(int msgInterval) {
     int numberOfRegions = this.regionLoad.size();
     StringBuilder sb = new StringBuilder();
-    sb = Strings.appendKeyValue(sb, "requests",
+    sb = Strings.appendKeyValue(sb, "requestsPerSecond",
       Integer.valueOf(numberOfRequests/msgInterval));
-    sb = Strings.appendKeyValue(sb, "regions",
+    sb = Strings.appendKeyValue(sb, "numberOfOnlineRegions",
       Integer.valueOf(numberOfRegions));
-    sb = Strings.appendKeyValue(sb, "usedHeap",
+    sb = Strings.appendKeyValue(sb, "usedHeapMB",
       Integer.valueOf(this.usedHeapMB));
-    sb = Strings.appendKeyValue(sb, "maxHeap", Integer.valueOf(maxHeapMB));
+    sb = Strings.appendKeyValue(sb, "maxHeapMB", Integer.valueOf(maxHeapMB));
     return sb.toString();
   }
 

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java?rev=1156336&r1=1156335&r2=1156336&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java Wed Aug
10 19:42:30 2011
@@ -594,11 +594,11 @@ public class LruBlockCache implements Bl
         "accesses=" + stats.getRequestCount() + ", " +
         "hits=" + stats.getHitCount() + ", " +
         "hitRatio=" +
-          (stats.getHitCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitRatio(),
2) + "%, ")) +
+          (stats.getHitCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitRatio(),
2)+ ", ")) +
         "cachingAccesses=" + stats.getRequestCachingCount() + ", " +
         "cachingHits=" + stats.getHitCachingCount() + ", " +
         "cachingHitsRatio=" +
-          (stats.getHitCachingCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitCachingRatio(),
2) + "%, ")) +
+          (stats.getHitCachingCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitCachingRatio(),
2)+ ", ")) +
         "evictions=" + stats.getEvictionCount() + ", " +
         "evicted=" + stats.getEvictedCount() + ", " +
         "evictedPerRun=" + stats.evictedPerEviction());

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java?rev=1156336&r1=1156335&r2=1156336&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
(original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
Wed Aug 10 19:42:30 2011
@@ -38,6 +38,7 @@ import org.apache.hadoop.metrics.util.Me
 import org.apache.hadoop.metrics.util.MetricsLongValue;
 import org.apache.hadoop.metrics.util.MetricsRegistry;
 import org.apache.hadoop.metrics.util.MetricsTimeVaryingRate;
+import org.apache.hadoop.util.StringUtils;
 
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
@@ -356,19 +357,15 @@ public class RegionServerMetrics impleme
   @Override
   public String toString() {
     StringBuilder sb = new StringBuilder();
-    int seconds = (int)((System.currentTimeMillis() - this.lastUpdate)/1000);
-    if (seconds == 0) {
-      seconds = 1;
-    }
-    sb = Strings.appendKeyValue(sb, "request",
+    sb = Strings.appendKeyValue(sb, "requestsPerSecond",
       Float.valueOf(this.requests.getPreviousIntervalValue()));
-    sb = Strings.appendKeyValue(sb, "regions",
+    sb = Strings.appendKeyValue(sb, "numberOfOnlineRegions",
       Integer.valueOf(this.regions.get()));
-    sb = Strings.appendKeyValue(sb, "stores",
+    sb = Strings.appendKeyValue(sb, "numberOfStores",
       Integer.valueOf(this.stores.get()));
-    sb = Strings.appendKeyValue(sb, "storefiles",
+    sb = Strings.appendKeyValue(sb, "numberOfStorefiles",
       Integer.valueOf(this.storefiles.get()));
-    sb = Strings.appendKeyValue(sb, "storefileIndexSize",
+    sb = Strings.appendKeyValue(sb, this.storefileIndexSizeMB.getName(),
       Integer.valueOf(this.storefileIndexSizeMB.get()));
     sb = Strings.appendKeyValue(sb, "rootIndexSizeKB",
         Integer.valueOf(this.rootIndexSizeKB.get()));
@@ -376,7 +373,7 @@ public class RegionServerMetrics impleme
         Integer.valueOf(this.totalStaticIndexSizeKB.get()));
     sb = Strings.appendKeyValue(sb, "totalStaticBloomSizeKB",
         Integer.valueOf(this.totalStaticBloomSizeKB.get()));
-    sb = Strings.appendKeyValue(sb, "memstoreSize",
+    sb = Strings.appendKeyValue(sb, this.memstoreSizeMB.getName(),
       Integer.valueOf(this.memstoreSizeMB.get()));
     sb = Strings.appendKeyValue(sb, "readRequestsCount",
         Long.valueOf(this.readRequestsCount.get()));
@@ -390,14 +387,14 @@ public class RegionServerMetrics impleme
     // inaccessible.
     MemoryUsage memory =
       ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
-    sb = Strings.appendKeyValue(sb, "usedHeap",
+    sb = Strings.appendKeyValue(sb, "usedHeapMB",
       Long.valueOf(memory.getUsed()/MB));
-    sb = Strings.appendKeyValue(sb, "maxHeap",
+    sb = Strings.appendKeyValue(sb, "maxHeapMB",
       Long.valueOf(memory.getMax()/MB));
-    sb = Strings.appendKeyValue(sb, this.blockCacheSize.getName(),
-        Long.valueOf(this.blockCacheSize.get()));
-    sb = Strings.appendKeyValue(sb, this.blockCacheFree.getName(),
-        Long.valueOf(this.blockCacheFree.get()));
+    sb = Strings.appendKeyValue(sb, this.blockCacheSize.getName()+"MB",
+    	StringUtils.limitDecimalTo2((float)this.blockCacheSize.get()/MB));
+    sb = Strings.appendKeyValue(sb, this.blockCacheFree.getName()+"MB",
+    	StringUtils.limitDecimalTo2((float)this.blockCacheFree.get()/MB));
     sb = Strings.appendKeyValue(sb, this.blockCacheCount.getName(),
         Long.valueOf(this.blockCacheCount.get()));
     sb = Strings.appendKeyValue(sb, this.blockCacheHitCount.getName(),
@@ -407,9 +404,9 @@ public class RegionServerMetrics impleme
     sb = Strings.appendKeyValue(sb, this.blockCacheEvictedCount.getName(),
         Long.valueOf(this.blockCacheEvictedCount.get()));
     sb = Strings.appendKeyValue(sb, this.blockCacheHitRatio.getName(),
-        Long.valueOf(this.blockCacheHitRatio.get()));
+        Long.valueOf(this.blockCacheHitRatio.get())+"%");
     sb = Strings.appendKeyValue(sb, this.blockCacheHitCachingRatio.getName(),
-        Long.valueOf(this.blockCacheHitCachingRatio.get()));
+        Long.valueOf(this.blockCacheHitCachingRatio.get())+"%");
     return sb.toString();
   }
 }



Mime
View raw message