Browse Source

HADOOP-2903. Fix exception generated by Metrics while using pushMetric().
(girish vaitheeswaran via dhruba)



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@632186 13f79535-47bb-0310-9956-ffa450edef68

Dhruba Borthakur 17 năm trước cách đây
mục cha
commit
1453d5039a

+ 3 - 0
CHANGES.txt

@@ -94,6 +94,9 @@ Trunk (unreleased changes)
     HADOOP-2904.  Fix to RPC metrics to log the correct host name. 
     (girish vaitheeswaran via dhruba)
 
+    HADOOP-2903.  Fix exception generated by Metrics while using pushMetric().
+    (girish vaitheeswaran via dhruba)
+
 Release 0.16.1 - Unreleased
 
   IMPROVEMENTS

+ 1 - 1
src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java

@@ -126,7 +126,7 @@ public class MetricsTimeVaryingRate {
   public synchronized void pushMetric(final MetricsRecord mr) {
     intervalHeartBeat();
     mr.incrMetric(name + "_num_ops", getPreviousIntervalNumOps());
-    mr.incrMetric(name + "_avg_time", getPreviousIntervalAverageTime());
+    mr.incrMetric(name + "_avg_time", (int)getPreviousIntervalAverageTime());
   }
   
   /**