Skip to content
Snippets Groups Projects
Commit 86886893 authored by Patrick Wendell's avatar Patrick Wendell
Browse files

Various formatting changes

parent 735c951a
No related branches found
No related tags found
No related merge requests found
......@@ -495,13 +495,13 @@ private object Utils extends Logging {
ms match {
case t if t < second =>
"%dms".format(t)
"%d ms".format(t)
case t if t < minute =>
"%d.%03ds".format(t / second, t % second)
"%.1f s".format(t.toFloat / second)
case t if t < hour =>
"%d:%02d".format(t / minute, (t % minute) / second)
"%.1f m".format(t.toFloat / minute)
case t =>
"%d:%02d:%02d".format(t / hour, t % hour / minute, (t % hour) % minute / second)
"%.2f h".format(t.toFloat / hour)
}
}
......
......@@ -18,8 +18,6 @@ private[spark] class IndexPage(parent: JobProgressUI) {
val dateFmt = parent.dateFmt
def render(request: HttpServletRequest): Seq[Node] = {
val stageHeaders = Seq("Stage ID", "Origin", "Submitted", "Duration", "Progress",
"Tasks: Complete/Total", "Shuffle Activity", "Stored RDD")
val activeStages = listener.activeStages.toSeq
val completedStages = listener.completedStages.reverse.toSeq
val failedStages = listener.failedStages.reverse.toSeq
......@@ -67,9 +65,9 @@ private[spark] class IndexPage(parent: JobProgressUI) {
<svg width={width.toString} height={height.toString}>
<rect width={width.toString} height={height.toString}
fill="white" stroke="black" stroke-width="1" />
fill="white" stroke="rgb(51,51,51)" stroke-width="1" />
<rect width={completeWidth.toString} height={height.toString}
fill="rgb(51,51,51)" stroke="black" stroke-width="1" />
fill="rgb(0,136,204)" stroke="black" stroke-width="1" />
</svg>
}
......
......@@ -34,13 +34,13 @@ class UISuite extends FunSuite {
val hour = minute * 60
def str = Utils.msDurationToString(_)
assert(str(123) === "123ms")
assert(str(second) === "1.000s")
assert(str(second + 452) === "1.452s")
assert(str(hour) === "1:00:00")
assert(str(minute) === "1:00")
assert(str(minute + 4 * second + 34) === "1:04")
assert(str(10 * hour + minute + 4 * second) === "10:01:04")
assert(str(10 * hour + 59 * minute + 59 * second + 999) === "10:59:59")
assert(str(123) === "123 ms")
assert(str(second) === "1.0 s")
assert(str(second + 462) === "1.5 s")
assert(str(hour) === "1.00 h")
assert(str(minute) === "1.0 m")
assert(str(minute + 4 * second + 34) === "1.1 m")
assert(str(10 * hour + minute + 4 * second) === "10.02 h")
assert(str(10 * hour + 59 * minute + 59 * second + 999) === "11.00 h")
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment