You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2014/05/14 21:01:19 UTC
git commit: SPARK-1829 Sub-second durations shouldn't round to "0 s"
Repository: spark
Updated Branches:
refs/heads/master fde82c154 -> a3315d7f4
SPARK-1829 Sub-second durations shouldn't round to "0 s"
As "99 ms" up to 99 ms
As "0.1 s" from 0.1 s up to 0.9 s
https://issues.apache.org/jira/browse/SPARK-1829
Compare the first image to the second here: http://imgur.com/RaLEsSZ,7VTlgfo#0
Author: Andrew Ash <an...@andrewash.com>
Closes #768 from ash211/spark-1829 and squashes the following commits:
1c15b8e [Andrew Ash] SPARK-1829 Format sub-second durations more appropriately
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/a3315d7f
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/a3315d7f
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/a3315d7f
Branch: refs/heads/master
Commit: a3315d7f4c7584dae2ee0aa33c6ec9e97b229b48
Parents: fde82c1
Author: Andrew Ash <an...@andrewash.com>
Authored: Wed May 14 12:01:14 2014 -0700
Committer: Reynold Xin <rx...@apache.org>
Committed: Wed May 14 12:01:14 2014 -0700
----------------------------------------------------------------------
core/src/main/scala/org/apache/spark/ui/UIUtils.scala | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/a3315d7f/core/src/main/scala/org/apache/spark/ui/UIUtils.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/ui/UIUtils.scala b/core/src/main/scala/org/apache/spark/ui/UIUtils.scala
index a3d6a18..a43314f 100644
--- a/core/src/main/scala/org/apache/spark/ui/UIUtils.scala
+++ b/core/src/main/scala/org/apache/spark/ui/UIUtils.scala
@@ -36,7 +36,13 @@ private[spark] object UIUtils extends Logging {
def formatDate(timestamp: Long): String = dateFormat.get.format(new Date(timestamp))
def formatDuration(milliseconds: Long): String = {
+ if (milliseconds < 100) {
+ return "%d ms".format(milliseconds)
+ }
val seconds = milliseconds.toDouble / 1000
+ if (seconds < 1) {
+ return "%.1f s".format(seconds)
+ }
if (seconds < 60) {
return "%.0f s".format(seconds)
}