Skip to content

Commit a349d0e

Browse files
committed
Added "Stage Summary" field to the json data returned from StagePage#renderJson
1 parent 2f8f9f3 commit a349d0e

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,31 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
4040
val stageId = request.getParameter("id").toInt
4141
val stageAttemptId = request.getParameter("attempt").toInt
4242

43+
var stageSummary = ("Stage ID" -> stageId) ~ ("Stage Attempt ID" -> stageAttemptId)
44+
45+
4346
val stageDataOpt = listener.stageIdToData.get((stageId, stageAttemptId))
4447
var retVal: JValue = JNothing
4548

4649
if (!stageDataOpt.isEmpty && !stageDataOpt.get.taskData.isEmpty) {
4750
val stageData = stageDataOpt.get
51+
52+
stageSummary ~= ("Executor Run Time" -> stageData.executorRunTime)
53+
if (stageData.inputBytes > 0) stageSummary ~= ("Input Bytes" -> stageData.inputBytes)
54+
if (stageData.shuffleReadBytes > 0) {
55+
stageSummary ~= ("Shuffle Read Bytes" -> stageData.shuffleReadBytes)
56+
}
57+
58+
if (stageData.shuffleWriteBytes > 0) {
59+
stageSummary ~= ("Shuffle Write bytes" -> stageData.shuffleWriteBytes)
60+
}
61+
62+
if (stageData.memoryBytesSpilled > 0 && stageData.diskBytesSpilled > 0) {
63+
stageSummary ~=
64+
("Memory Bytes Spilled" -> stageData.memoryBytesSpilled) ~
65+
("Disk Bytes Spilled" -> stageData.diskBytesSpilled)
66+
}
67+
4868
val tasks = stageData.taskData.values.toSeq.sortBy(_.taskInfo.launchTime)
4969

5070
val taskList = tasks.map {
@@ -61,7 +81,11 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
6181
}
6282
jsonTaskInfo
6383
}
64-
retVal = ("Task List" -> taskList)
84+
85+
retVal =
86+
("Stage Info" ->
87+
("StageSummary" -> stageSummary) ~
88+
("Tasks" -> taskList))
6589
}
6690
retVal
6791
}

0 commit comments

Comments
 (0)