From fdcfef0a26709c1c0779c822c76c1b3cc3324471 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Eagles Date: Fri, 30 Nov 2012 21:43:43 +0000 Subject: [PATCH] MAPREDUCE-4836. Elapsed time for running tasks on AM web UI tasks page is 0. (Ravi Prakash via jeagles) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1415860 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../apache/hadoop/mapreduce/v2/app/webapp/dao/TaskInfo.java | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 1c72e053ec2..efd23cd88d6 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -604,6 +604,9 @@ Release 0.23.6 - UNRELEASED MAPREDUCE-4817. Hardcoded task ping timeout kills tasks localizing large amounts of data (tgraves) + MAPREDUCE-4836. Elapsed time for running tasks on AM web UI tasks page is 0 + (Ravi Prakash via jeagles) + Release 0.23.5 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/TaskInfo.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/TaskInfo.java index aab8b56d911..40983400aef 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/TaskInfo.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/webapp/dao/TaskInfo.java @@ -59,11 +59,12 @@ public class TaskInfo { TaskReport report = task.getReport(); this.startTime = report.getStartTime(); this.finishTime = report.getFinishTime(); - this.elapsedTime = Times.elapsed(this.startTime, this.finishTime, false); + this.state = report.getTaskState(); + this.elapsedTime = Times.elapsed(this.startTime, this.finishTime, + this.state == TaskState.RUNNING); if (this.elapsedTime == -1) { this.elapsedTime = 0; } - this.state = report.getTaskState(); this.progress = report.getProgress() * 100; this.id = MRApps.toString(task.getID()); this.taskNum = task.getID().getId();