Skip to content

Commit 335be4b

Browse files
committed
Made metrics hideable
1 parent 5bc3cba commit 335be4b

File tree

2 files changed

+46
-6
lines changed

2 files changed

+46
-6
lines changed

core/src/main/scala/org/apache/spark/ui/ToolTips.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@
1818
package org.apache.spark.ui
1919

2020
private[spark] object ToolTips {
21-
val EXECUTOR_LAUNCH_TIME =
22-
"""Overhead associated with launching the task in its own thread on the executor."""
23-
2421
val SCHEDULER_DELAY =
2522
"""Scheduler delay includes time to ship the task from the scheduler to
2623
the executor, and time to send the task result from the executor to the scheduler. If
2724
scheduler delay is large, consider decreasing the size of tasks or decreasing the size
2825
of task results."""
2926

27+
val EXECUTOR_LAUNCH_TIME =
28+
"""Overhead associated with launching the task in its own thread on the executor."""
29+
30+
val TASK_DESERIALIZATION_TIME =
31+
"""Time spent deserializating the task closure on the executor."""
32+
3033
val INPUT = "Bytes read from Hadoop or from Spark storage."
3134

3235
val SHUFFLE_WRITE = "Bytes written to disk in order to be read by a shuffle in a future stage."

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

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,20 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
119119
<span class="additional-metric-title">GC Time</span>
120120
</span>
121121
</li>
122+
<li>
123+
<span data-toggle="tooltip"
124+
title={ToolTips.EXECUTOR_LAUNCH_TIME} data-placement="right">
125+
<input type="checkbox" name={TaskDetailsClassNames.EXECUTOR_LAUNCH_TIME}/>
126+
<span class="additional-metric-title">Executor Launch Time</span>
127+
</span>
128+
</li>
129+
<li>
130+
<span data-toggle="tooltip"
131+
title={ToolTips.TASK_DESERIALIZATION_TIME} data-placement="right">
132+
<input type="checkbox" name={TaskDetailsClassNames.TASK_DESERIALIZATION_TIME}/>
133+
<span class="additional-metric-title">Task Deserialization Time</span>
134+
</span>
135+
</li>
122136
<li>
123137
<span data-toggle="tooltip"
124138
title={ToolTips.RESULT_SERIALIZATION_TIME} data-placement="right">
@@ -148,6 +162,8 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
148162
("Executor ID / Host", ""), ("Launch Time", ""), ("Duration", ""),
149163
("Scheduler Delay", TaskDetailsClassNames.SCHEDULER_DELAY),
150164
("GC Time", TaskDetailsClassNames.GC_TIME),
165+
("Executor Launch Time", TaskDetailsClassNames.EXECUTOR_LAUNCH_TIME),
166+
("Task Deserialization Time", TaskDetailsClassNames.TASK_DESERIALIZATION_TIME),
151167
("Result Serialization Time", TaskDetailsClassNames.RESULT_SERIALIZATION_TIME),
152168
("Getting Result Time", TaskDetailsClassNames.GETTING_RESULT_TIME)) ++
153169
{if (hasAccumulators) Seq(("Accumulators", "")) else Nil} ++
@@ -182,16 +198,26 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
182198
val executorLaunchTimes = validTasks.map { case TaskUIData(_, metrics, _) =>
183199
metrics.get.executorLaunchTime.toDouble
184200
}
185-
val executorLaunchTitle = <td><span data-toggle="tooltip"
186-
title={ToolTips.EXECUTOR_LAUNCH_TIME} data-placement="right">Launch time</span></td>
201+
val executorLaunchTitle =
202+
<td>
203+
<span data-toggle="tooltip" title={ToolTips.EXECUTOR_LAUNCH_TIME}
204+
data-placement="right">
205+
Executor Launch Time
206+
</span>
207+
</td>
187208
val executorLaunchQuantiles =
188209
executorLaunchTitle +: getFormattedTimeQuantiles(executorLaunchTimes)
189210

190211
val deserializationTimes = validTasks.map { case TaskUIData(_, metrics, _) =>
191212
metrics.get.executorDeserializeTime.toDouble
192213
}
193214
val deserializationQuantiles =
194-
<td>Task deserialization time</td> +: getFormattedTimeQuantiles(deserializationTimes)
215+
<td>
216+
<span data-toggle="tooltip" title={ToolTips.TASK_DESERIALIZATION_TIME}
217+
data-placement="right">
218+
Task Deserialization Time
219+
</span>
220+
</td> +: getFormattedTimeQuantiles(deserializationTimes)
195221

196222
val serviceTimes = validTasks.map { case TaskUIData(_, metrics, _) =>
197223
metrics.get.executorRunTime.toDouble
@@ -333,7 +359,10 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
333359
else metrics.map(m => UIUtils.formatDuration(m.executorRunTime)).getOrElse("")
334360
val schedulerDelay = getSchedulerDelay(info, metrics.get)
335361
val gcTime = metrics.map(_.jvmGCTime).getOrElse(0L)
362+
val executorLaunchTime = metrics.map(_.executorLaunchTime).getOrElse(0L)
363+
val taskDeserializationTime = metrics.map(_.executorDeserializeTime).getOrElse(0L)
336364
val serializationTime = metrics.map(_.resultSerializationTime).getOrElse(0L)
365+
337366
val gettingResultTime = info.gettingResultTime
338367

339368
val maybeAccumulators = info.accumulables
@@ -389,6 +418,14 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
389418
<td sorttable_customkey={gcTime.toString} class={TaskDetailsClassNames.GC_TIME}>
390419
{if (gcTime > 0) UIUtils.formatDuration(gcTime) else ""}
391420
</td>
421+
<td sorttable_customkey={executorLaunchTime.toString}
422+
class={TaskDetailsClassNames.EXECUTOR_LAUNCH_TIME}>
423+
{UIUtils.formatDuration(executorLaunchTime.toLong)}
424+
</td>
425+
<td sorttable_customkey={taskDeserializationTime.toString}
426+
class={TaskDetailsClassNames.TASK_DESERIALIZATION_TIME}>
427+
{UIUtils.formatDuration(taskDeserializationTime.toLong)}
428+
</td>
392429
<td sorttable_customkey={serializationTime.toString}
393430
class={TaskDetailsClassNames.RESULT_SERIALIZATION_TIME}>
394431
{UIUtils.formatDuration(serializationTime)}

0 commit comments

Comments
 (0)