You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by je...@apache.org on 2014/11/17 20:22:23 UTC

[14/50] [abbrv] tez git commit: TEZ-1725. Fix nanosecond to millis conversion in TezMxBeanResourceCalculator (Rajesh Balamohan)

TEZ-1725. Fix nanosecond to millis conversion in TezMxBeanResourceCalculator  (Rajesh Balamohan)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/b66ff72c
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/b66ff72c
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/b66ff72c

Branch: refs/heads/TEZ-8
Commit: b66ff72cc02d333d36c312562b7f06ac174e9830
Parents: 81322ef
Author: Rajesh Balamohan <rb...@apache.org>
Authored: Fri Oct 31 12:22:59 2014 +0530
Committer: Rajesh Balamohan <rb...@apache.org>
Committed: Fri Oct 31 12:22:59 2014 +0530

----------------------------------------------------------------------
 CHANGES.txt                                                     | 1 +
 tez-plugins/pom.xml                                             | 4 +++-
 .../java/org/apache/tez/util/TezMxBeanResourceCalculator.java   | 5 +----
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/b66ff72c/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 3fdd96e..9c28485 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -95,6 +95,7 @@ ALL CHANGES:
   TEZ-1703. Exception handling for InputInitializer.
   TEZ-1698. Cut down on ResourceCalculatorProcessTree overheads in Tez.
   TEZ-1703. addendum - fix flaky test.
+  TEZ-1725. Fix nanosecond to millis conversion in TezMxBeanResourceCalculator.
 
 Release 0.5.1: 2014-10-02
 

http://git-wip-us.apache.org/repos/asf/tez/blob/b66ff72c/tez-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/tez-plugins/pom.xml b/tez-plugins/pom.xml
index 7c15215..b6ce081 100644
--- a/tez-plugins/pom.xml
+++ b/tez-plugins/pom.xml
@@ -30,7 +30,9 @@
     <profile>
       <id>hadoop24</id>
       <activation>
-         <activeByDefault>true</activeByDefault>
+        <property>
+          <name>!skipATS</name>
+        </property>
       </activation>
       <modules>
         <module>tez-yarn-timeline-history</module>

http://git-wip-us.apache.org/repos/asf/tez/blob/b66ff72c/tez-plugins/tez-mbeans-resource-calculator/src/main/java/org/apache/tez/util/TezMxBeanResourceCalculator.java
----------------------------------------------------------------------
diff --git a/tez-plugins/tez-mbeans-resource-calculator/src/main/java/org/apache/tez/util/TezMxBeanResourceCalculator.java b/tez-plugins/tez-mbeans-resource-calculator/src/main/java/org/apache/tez/util/TezMxBeanResourceCalculator.java
index 330a2fd..4aa8f85 100644
--- a/tez-plugins/tez-mbeans-resource-calculator/src/main/java/org/apache/tez/util/TezMxBeanResourceCalculator.java
+++ b/tez-plugins/tez-mbeans-resource-calculator/src/main/java/org/apache/tez/util/TezMxBeanResourceCalculator.java
@@ -31,7 +31,6 @@ public class TezMxBeanResourceCalculator extends ResourceCalculatorProcessTree {
 
   private final com.sun.management.OperatingSystemMXBean osBean;
   private final Runtime runtime;
-  private final AtomicLong cumulativeCPU;
 
   /**
    * Create process-tree instance with specified root process.
@@ -45,7 +44,6 @@ public class TezMxBeanResourceCalculator extends ResourceCalculatorProcessTree {
     runtime = Runtime.getRuntime();
     osBean =
         (com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
-    cumulativeCPU = new AtomicLong();
   }
 
   @Override public void updateProcessTree() {
@@ -67,8 +65,7 @@ public class TezMxBeanResourceCalculator extends ResourceCalculatorProcessTree {
 
   @Override public long getCumulativeCpuTime() {
     //convert to milliseconds
-    return TimeUnit.MILLISECONDS.convert(cumulativeCPU.addAndGet(osBean.getProcessCpuTime()),
-        TimeUnit.MILLISECONDS);
+    return TimeUnit.MILLISECONDS.convert(osBean.getProcessCpuTime(), TimeUnit.NANOSECONDS);
   }
 
   @Override public boolean checkPidPgrpidForMatch() {