hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jg...@apache.org
Subject svn commit: r1041935 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
Date Fri, 03 Dec 2010 17:56:03 GMT
Author: jgray
Date: Fri Dec  3 17:56:03 2010
New Revision: 1041935

URL: http://svn.apache.org/viewvc?rev=1041935&view=rev
Log:
HBASE-3292 Expose block cache hit/miss/evict counts into region server metrics

Modified:
    hbase/branches/0.90/CHANGES.txt
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
    hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java

Modified: hbase/branches/0.90/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1041935&r1=1041934&r2=1041935&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Fri Dec  3 17:56:03 2010
@@ -1205,6 +1205,8 @@ Release 0.90.0 - Unreleased
    HBASE-3223  Get VersionInfo for Running HBase Process
                (Nicolas Spiegelberg via Stack)
    HBASE-3303  Lower hbase.regionserver.handler.count from 25 back to 10
+   HBASE-3292  Expose block cache hit/miss/evict counts into region server
+               metrics
 
 
   NEW FEATURES

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1041935&r1=1041934&r2=1041935&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Fri Dec  3 17:56:03 2010
@@ -94,6 +94,7 @@ import org.apache.hadoop.hbase.client.Sc
 import org.apache.hadoop.hbase.executor.ExecutorService;
 import org.apache.hadoop.hbase.executor.ExecutorService.ExecutorType;
 import org.apache.hadoop.hbase.io.hfile.LruBlockCache;
+import org.apache.hadoop.hbase.io.hfile.LruBlockCache.CacheStats;
 import org.apache.hadoop.hbase.ipc.HBaseRPC;
 import org.apache.hadoop.hbase.ipc.HBaseRPCErrorHandler;
 import org.apache.hadoop.hbase.ipc.HBaseRPCProtocolVersion;
@@ -1157,6 +1158,10 @@ public class HRegionServer implements HR
       this.metrics.blockCacheCount.set(lruBlockCache.size());
       this.metrics.blockCacheFree.set(lruBlockCache.getFreeSize());
       this.metrics.blockCacheSize.set(lruBlockCache.getCurrentSize());
+      CacheStats cacheStats = lruBlockCache.getStats();
+      this.metrics.blockCacheHitCount.set(cacheStats.getHitCount());
+      this.metrics.blockCacheMissCount.set(cacheStats.getMissCount());
+      this.metrics.blockCacheEvictedCount.set(lruBlockCache.getEvictedCount());
       double ratio = lruBlockCache.getStats().getHitRatio();
       int percent = (int) (ratio * 100);
       this.metrics.blockCacheHitRatio.set(percent);

Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java?rev=1041935&r1=1041934&r2=1041935&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
(original)
+++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
Fri Dec  3 17:56:03 2010
@@ -87,6 +87,21 @@ public class RegionServerMetrics impleme
   public final MetricsLongValue blockCacheCount = new MetricsLongValue("blockCacheCount",
registry);
 
   /**
+   * Block cache hit count.
+   */
+  public final MetricsLongValue blockCacheHitCount = new MetricsLongValue("blockCacheHitCount",
registry);
+
+  /**
+   * Block cache miss count.
+   */
+  public final MetricsLongValue blockCacheMissCount = new MetricsLongValue("blockCacheMissCount",
registry);
+
+  /**
+   * Block cache evict count.
+   */
+  public final MetricsLongValue blockCacheEvictedCount = new MetricsLongValue("blockCacheEvictedCount",
registry);
+
+  /**
    * Block hit ratio.
    */
   public final MetricsIntValue blockCacheHitRatio = new MetricsIntValue("blockCacheHitRatio",
registry);
@@ -228,6 +243,9 @@ public class RegionServerMetrics impleme
       this.blockCacheSize.pushMetric(this.metricsRecord);
       this.blockCacheFree.pushMetric(this.metricsRecord);
       this.blockCacheCount.pushMetric(this.metricsRecord);
+      this.blockCacheHitCount.pushMetric(this.metricsRecord);
+      this.blockCacheMissCount.pushMetric(this.metricsRecord);
+      this.blockCacheEvictedCount.pushMetric(this.metricsRecord);
       this.blockCacheHitRatio.pushMetric(this.metricsRecord);
       this.blockCacheHitCachingRatio.pushMetric(this.metricsRecord);
 
@@ -336,6 +354,12 @@ public class RegionServerMetrics impleme
         Long.valueOf(this.blockCacheFree.get()));
     sb = Strings.appendKeyValue(sb, this.blockCacheCount.getName(),
         Long.valueOf(this.blockCacheCount.get()));
+    sb = Strings.appendKeyValue(sb, this.blockCacheHitCount.getName(),
+        Long.valueOf(this.blockCacheHitCount.get()));
+    sb = Strings.appendKeyValue(sb, this.blockCacheMissCount.getName(),
+        Long.valueOf(this.blockCacheMissCount.get()));
+    sb = Strings.appendKeyValue(sb, this.blockCacheEvictedCount.getName(),
+        Long.valueOf(this.blockCacheEvictedCount.get()));
     sb = Strings.appendKeyValue(sb, this.blockCacheHitRatio.getName(),
         Long.valueOf(this.blockCacheHitRatio.get()));
     sb = Strings.appendKeyValue(sb, this.blockCacheHitCachingRatio.getName(),



Mime
View raw message