Skip to content

Commit

Permalink
Update as per review and increase the max height of the stack trace d…
Browse files Browse the repository at this point in the history
…etails
  • Loading branch information
zsxwing committed Nov 4, 2014
1 parent 94f2566 commit 1e50f71
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
14 changes: 14 additions & 0 deletions core/src/main/resources/org/apache/spark/ui/static/webui.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ pre {
border: none;
}

.stacktrace-details {
max-height: 300px;
overflow-y: auto;
margin: 0;
transition: max-height 0.5s ease-out, padding 0.5s ease-out;
}

.stacktrace-details.collapsed {
max-height: 0;
padding-top: 0;
padding-bottom: 0;
border: none;
}

span.expand-additional-metrics {
cursor: pointer;
}
Expand Down
6 changes: 4 additions & 2 deletions core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,15 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
error
})
val details = if (isMultiline) {
<span onclick="this.parentNode.querySelector('.stage-details').classList.toggle('collapsed')"
// scalastyle:off
<span onclick="this.parentNode.querySelector('.stacktrace-details').classList.toggle('collapsed')"
class="expand-details">
+details
</span> ++
<div class="stage-details collapsed">
<div class="stacktrace-details collapsed">
<pre>{error}</pre>
</div>
// scalastyle:on
} else {
""
}
Expand Down
6 changes: 4 additions & 2 deletions core/src/main/scala/org/apache/spark/ui/jobs/StageTable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,15 @@ private[ui] class FailedStageTable(
failureReason
})
val details = if (isMultiline) {
<span onclick="this.parentNode.querySelector('.stage-details').classList.toggle('collapsed')"
// scalastyle:off
<span onclick="this.parentNode.querySelector('.stacktrace-details').classList.toggle('collapsed')"
class="expand-details">
+details
</span> ++
<div class="stage-details collapsed">
<div class="stacktrace-details collapsed">
<pre>{failureReason}</pre>
</div>
// scalastyle:on
} else {
""
}
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,9 @@ private[spark] object Utils extends Logging {

/** Return a nice string representation of the exception, including the stack trace. */
def exceptionString(e: Throwable): String = {
if (e == null) ""
if (e == null) {
""
}
else {
val stringWriter = new StringWriter()
e.printStackTrace(new PrintWriter(stringWriter))
Expand All @@ -1609,6 +1611,7 @@ private[spark] object Utils extends Logging {
/**
* Return a nice string representation of the exception, including the stack trace.
* It's only used for backward compatibility.
* Note: deprecated because it does not include the exception's cause.
*/
@deprecated("Use exceptionString(Throwable) instead", "1.2.0")
def exceptionString(
Expand Down

0 comments on commit 1e50f71

Please sign in to comment.