hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xg...@apache.org
Subject hadoop git commit: YARN-3056. Add verification for containerLaunchDuration in TestNodeManagerMetrics. Contributed by zhihai Xu
Date Tue, 03 Feb 2015 23:14:35 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 debd63f0b -> c22dcdd19


YARN-3056. Add verification for containerLaunchDuration in
TestNodeManagerMetrics. Contributed by zhihai Xu

(cherry picked from commit b73e776abc3e2479e397729c2bab9668f469e593)


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

Branch: refs/heads/branch-2
Commit: c22dcdd1917932fe0d871a0627427ae443136ae7
Parents: debd63f
Author: Xuan <xgong@apache.org>
Authored: Tue Feb 3 15:12:54 2015 -0800
Committer: Xuan <xgong@apache.org>
Committed: Tue Feb 3 15:14:23 2015 -0800

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                                | 3 +++
 .../server/nodemanager/metrics/TestNodeManagerMetrics.java     | 6 ++++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c22dcdd1/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index 326c674..cd939c6 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -433,6 +433,9 @@ Release 2.7.0 - UNRELEASED
 
     YARN-3113. Release audit warning for Sorting icons.psd. (stevel via kihwal)
 
+    YARN-3056. Add verification for containerLaunchDuration
+    in TestNodeManagerMetrics. (zhihai xu via xgong)
+
 Release 2.6.0 - 2014-11-18
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c22dcdd1/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/metrics/TestNodeManagerMetrics.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/metrics/TestNodeManagerMetrics.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/metrics/TestNodeManagerMetrics.java
index d2a0691..4dc4648 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/metrics/TestNodeManagerMetrics.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/metrics/TestNodeManagerMetrics.java
@@ -17,17 +17,20 @@
  */
 package org.apache.hadoop.yarn.server.nodemanager.metrics;
 
+import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
 import org.apache.hadoop.metrics2.MetricsRecordBuilder;
 import static org.apache.hadoop.test.MetricsAsserts.*;
 import org.apache.hadoop.yarn.api.records.Resource;
 import org.apache.hadoop.yarn.util.Records;
 
+import org.junit.Assert;
 import org.junit.Test;
 
 public class TestNodeManagerMetrics {
   static final int GiB = 1024; // MiB
 
   @Test public void testNames() {
+    DefaultMetricsSystem.initialize("NodeManager");
     NodeManagerMetrics metrics = NodeManagerMetrics.create();
     Resource total = Records.newRecord(Resource.class);
     total.setMemory(8*GiB);
@@ -61,7 +64,10 @@ public class TestNodeManagerMetrics {
 
     metrics.initingContainer();
     metrics.runningContainer();
+
+    Assert.assertTrue(!metrics.containerLaunchDuration.changed());
     metrics.addContainerLaunchDuration(1);
+    Assert.assertTrue(metrics.containerLaunchDuration.changed());
 
     // availableGB is expected to be floored,
     // while allocatedGB is expected to be ceiled.


Mime
View raw message