Fix small div-by-zero exception found in an FB test cluster

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1050226 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nicolas Spiegelberg 2010-12-16 23:23:54 +00:00
parent 605ebb05ec
commit 28012b50ce
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ public class PersistentMetricsTimeVaryingRate extends MetricsTimeVaryingRate {
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");