hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1361028 - in /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver: HRegionServer.java metrics/RegionServerMetrics.java
Date Fri, 13 Jul 2012 01:04:23 GMT
Author: apurtell
Date: Fri Jul 13 01:04:23 2012
New Revision: 1361028

URL: http://svn.apache.org/viewvc?rev=1361028&view=rev
Log:
HBASE-6377. HBASE-5533 metrics miss all operations submitted via MultiAction

Applied 6377-0.94-remove-get-put-delete-histograms.patch

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

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1361028&r1=1361027&r2=1361028&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Fri Jul 13 01:04:23 2012
@@ -1952,15 +1952,12 @@ public class HRegionServer implements HR
   /** {@inheritDoc} */
   public Result get(byte[] regionName, Get get) throws IOException {
     checkOpen();
-    final long startTime = System.nanoTime();
     requestCount.incrementAndGet();
     try {
       HRegion region = getRegion(regionName);
       return region.get(get, getLockFromId(get.getLockId()));
     } catch (Throwable t) {
       throw convertThrowableToIOE(cleanup(t));
-    } finally {
-      this.metrics.getLatencies.update(System.nanoTime() - startTime);
     }
   }
 
@@ -1992,7 +1989,6 @@ public class HRegionServer implements HR
       throw new IllegalArgumentException("update has null row");
     }
 
-    final long startTime = System.nanoTime();
     checkOpen();
     this.requestCount.incrementAndGet();
     HRegion region = getRegion(regionName);
@@ -2004,8 +2000,6 @@ public class HRegionServer implements HR
       region.put(put, getLockFromId(put.getLockId()), writeToWAL);
     } catch (Throwable t) {
       throw convertThrowableToIOE(cleanup(t));
-    } finally {
-      this.metrics.putLatencies.update(System.nanoTime() - startTime);
     }
   }
 
@@ -2015,7 +2009,6 @@ public class HRegionServer implements HR
     HRegion region = null;
     int i = 0;
 
-    final long startTime = System.nanoTime();
     try {
       region = getRegion(regionName);
       if (!region.getRegionInfo().isMetaTable()) {
@@ -2040,14 +2033,6 @@ public class HRegionServer implements HR
       return -1;
     } catch (Throwable t) {
       throw convertThrowableToIOE(cleanup(t));
-    } finally {
-      // going to count this as puts.size() PUTs for latency calculations
-      final long totalTime = System.nanoTime() - startTime;
-      final long putCount = i;
-      final long perPutTime = totalTime / putCount;
-      for (int request = 0; request < putCount; request++) {
-        this.metrics.putLatencies.update(perPutTime);
-      }
     }
   }
 
@@ -2520,7 +2505,6 @@ public class HRegionServer implements HR
   public void delete(final byte[] regionName, final Delete delete)
       throws IOException {
     checkOpen();
-    final long startTime = System.nanoTime();
     try {
       boolean writeToWAL = delete.getWriteToWAL();
       this.requestCount.incrementAndGet();
@@ -2532,8 +2516,6 @@ public class HRegionServer implements HR
       region.delete(delete, lid, writeToWAL);
     } catch (Throwable t) {
       throw convertThrowableToIOE(cleanup(t));
-    } finally {
-      this.metrics.deleteLatencies.update(System.nanoTime() - startTime);
     }
   }
 
@@ -2551,12 +2533,10 @@ public class HRegionServer implements HR
       int size = deletes.size();
       Integer[] locks = new Integer[size];
       for (Delete delete : deletes) {
-        final long startTime = System.nanoTime();
         this.requestCount.incrementAndGet();
         locks[i] = getLockFromId(delete.getLockId());
         region.delete(delete, locks[i], delete.getWriteToWAL());
         i++;
-        this.metrics.deleteLatencies.update(System.nanoTime() - startTime);
       }
     } catch (WrongRegionException ex) {
       LOG.debug("Batch deletes: " + i, ex);

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java?rev=1361028&r1=1361027&r2=1361028&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java
Fri Jul 13 01:04:23 2012
@@ -130,25 +130,6 @@ public class RegionServerMetrics impleme
   /** Block hit caching ratio for past N periods */
   public final MetricsIntValue blockCacheHitCachingRatioPastNPeriods = new MetricsIntValue("blockCacheHitCachingRatioPastNPeriods",
registry);
 
-  /**
-   * a latency histogram on 'get' requests
-   */
-  public final MetricsHistogram getLatencies = 
-      new MetricsHistogram("getRequestLatency", registry);
- 
-  /**
-   * a latency histogram on 'delete' requests
-   */
-  public final MetricsHistogram deleteLatencies = 
-      new MetricsHistogram("deleteRequestLatency", registry);
- 
-  /**
-   * a latency histogram on 'put' requests
-   */
-  public final MetricsHistogram putLatencies = 
-      new MetricsHistogram("putRequestLatency", registry);
- 
-  
   /*
    * Count of requests to the regionservers since last call to metrics update
    */
@@ -395,10 +376,6 @@ public class RegionServerMetrics impleme
       this.blockCacheHitRatioPastNPeriods.pushMetric(this.metricsRecord);
       this.blockCacheHitCachingRatioPastNPeriods.pushMetric(this.metricsRecord);
 
-      this.putLatencies.pushMetric(this.metricsRecord);
-      this.deleteLatencies.pushMetric(this.metricsRecord);
-      this.getLatencies.pushMetric(this.metricsRecord);
-      
       // Mix in HFile and HLog metrics
       // Be careful. Here is code for MTVR from up in hadoop:
       // public synchronized void inc(final int numOps, final long time) {
@@ -586,9 +563,6 @@ public class RegionServerMetrics impleme
         Long.valueOf(this.hdfsBlocksLocalityIndex.get()));
     sb = Strings.appendKeyValue(sb, "slowHLogAppendCount",
         Long.valueOf(this.slowHLogAppendCount.get()));
-    sb = appendHistogram(sb, this.deleteLatencies);
-    sb = appendHistogram(sb, this.getLatencies);
-    sb = appendHistogram(sb, this.putLatencies);
     sb = appendHistogram(sb, this.fsReadLatencyHistogram);
     sb = appendHistogram(sb, this.fsPreadLatencyHistogram);
     sb = appendHistogram(sb, this.fsWriteLatencyHistogram);



Mime
View raw message