Skip to content

Commit

Permalink
[SPARK-26196][SPARK-26281][WEBUI] Total tasks title in the stage page…
Browse files Browse the repository at this point in the history
… is incorrect when there are failed or killed tasks and update duration metrics

## What changes were proposed in this pull request?
This PR fixes 3 issues
1) Total tasks message in the tasks table is incorrect, when there are failed or killed tasks
2) Sorting of the "Duration" column is not correct
3) Duration in the aggregated tasks summary table and the tasks table and not matching.

Total tasks  = numCompleteTasks +  numActiveTasks + numKilledTasks + numFailedTasks;

Corrected the duration metrics in the tasks table as executorRunTime based on the PR #23081

## How was this patch tested?
test step:
1)
```
bin/spark-shell
scala > sc.parallelize(1 to 100, 10).map{ x => throw new RuntimeException("Bad executor")}.collect()
```
![screenshot from 2018-11-28 07-26-00](https://user-images.githubusercontent.com/23054875/49123523-e2691880-f2de-11e8-9c16-60d1865e6e77.png)

After patch:
![screenshot from 2018-11-28 07-24-31](https://user-images.githubusercontent.com/23054875/49123525-e432dc00-f2de-11e8-89ca-4a53e19c9c18.png)

2)  Duration metrics:
Before patch:
![screenshot from 2018-12-06 03-25-14](https://user-images.githubusercontent.com/23054875/49546591-9e8d9900-f906-11e8-8a0b-157742c47655.png)

After patch:
![screenshot from 2018-12-06 03-23-14](https://user-images.githubusercontent.com/23054875/49546589-9cc3d580-f906-11e8-827f-52ef8ffdeaec.png)

Closes #23160 from shahidki31/totalTasks.

Authored-by: Shahid <shahidki31@gmail.com>
Signed-off-by: Sean Owen <sean.owen@databricks.com>
  • Loading branch information
shahidki31 authored and srowen committed Dec 7, 2018
1 parent bd00f10 commit 3b8ae23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -616,7 +616,8 @@ $(document).ready(function () {
$("#accumulator-table").DataTable(accumulatorConf);

// building tasks table that uses server side functionality
var totalTasksToShow = responseBody.numCompleteTasks + responseBody.numActiveTasks;
var totalTasksToShow = responseBody.numCompleteTasks + responseBody.numActiveTasks +
responseBody.numKilledTasks + responseBody.numFailedTasks;
var taskTable = "#active-tasks-table";
var taskConf = {
"serverSide": true,
Expand Down Expand Up @@ -667,8 +668,8 @@ $(document).ready(function () {
{data : "launchTime", name: "Launch Time", render: formatDate},
{
data : function (row, type) {
if (row.duration) {
return type === 'display' ? formatDuration(row.duration) : row.duration;
if (row.taskMetrics && row.taskMetrics.executorRunTime) {
return type === 'display' ? formatDuration(row.taskMetrics.executorRunTime) : row.taskMetrics.executorRunTime;
} else {
return "";
}
Expand Down Expand Up @@ -927,7 +928,7 @@ $(document).ready(function () {

// title number and toggle list
$("#summaryMetricsTitle").html("Summary Metrics for " + "<a href='#tasksTitle'>" + responseBody.numCompleteTasks + " Completed Tasks" + "</a>");
$("#tasksTitle").html("Task (" + totalTasksToShow + ")");
$("#tasksTitle").html("Tasks (" + totalTasksToShow + ")");

// hide or show the accumulate update table
if (accumulatorTable.length == 0) {
Expand Down
Expand Up @@ -210,7 +210,6 @@ private[v1] class StagesResource extends BaseAppResource {
(containsValue(f.taskId) || containsValue(f.index) || containsValue(f.attempt)
|| containsValue(f.launchTime)
|| containsValue(f.resultFetchStart.getOrElse(defaultOptionString))
|| containsValue(f.duration.getOrElse(defaultOptionString))
|| containsValue(f.executorId) || containsValue(f.host) || containsValue(f.status)
|| containsValue(f.taskLocality) || containsValue(f.speculative)
|| containsValue(f.errorMessage.getOrElse(defaultOptionString))
Expand Down

0 comments on commit 3b8ae23

Please sign in to comment.