hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nspiegelb...@apache.org
Subject svn commit: r1050226 - /hbase/trunk/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java
Date Thu, 16 Dec 2010 23:23:54 GMT
Author: nspiegelberg
Date: Thu Dec 16 23:23:54 2010
New Revision: 1050226

URL: http://svn.apache.org/viewvc?rev=1050226&view=rev
Log:
Fix small div-by-zero exception found in an FB test cluster

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java?rev=1050226&r1=1050225&r2=1050226&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java
(original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/metrics/PersistentMetricsTimeVaryingRate.java
Thu Dec 16 23:23:54 2010
@@ -128,7 +128,7 @@ public class PersistentMetricsTimeVaryin
     if (curOps > 0) {
       long curTime = this.getPreviousIntervalAverageTime();
       long totalTime = curTime * curOps;
-      if (totalTime / curTime == curOps) {
+      if (curTime == 0 || totalTime / curTime == curOps) {
         super.inc(curOps, totalTime);
       } else {
         LOG.info("Stats for " + this.getName() + " overflowed! resetting");



Mime
View raw message