aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/resources
diff options
context:
space:
mode:
authorzsxwing <zsxwing@gmail.com>2015-05-14 16:58:36 -0700
committerAndrew Or <andrew@databricks.com>2015-05-14 16:58:36 -0700
commitb208f998b5800bdba4ce6651f172c26a8d7d351b (patch)
tree6f32115e2e8aa7d56d54b6526ebfd83f8bc63e4f /core/src/main/resources
parent0a317c124c3a43089cdb8f079345c8f2842238cd (diff)
downloadspark-b208f998b5800bdba4ce6651f172c26a8d7d351b.tar.gz
spark-b208f998b5800bdba4ce6651f172c26a8d7d351b.tar.bz2
spark-b208f998b5800bdba4ce6651f172c26a8d7d351b.zip
[SPARK-7645] [STREAMING] [WEBUI] Show milliseconds in the UI if the batch interval < 1 second
I also updated the summary of the Streaming page. ![screen shot 2015-05-14 at 11 52 59 am](https://cloud.githubusercontent.com/assets/1000778/7640103/13cdf68e-fa36-11e4-84ec-e2a3954f4319.png) ![screen shot 2015-05-14 at 12 39 33 pm](https://cloud.githubusercontent.com/assets/1000778/7640151/4cc066ac-fa36-11e4-8494-2821d6a6f17c.png) Author: zsxwing <zsxwing@gmail.com> Closes #6154 from zsxwing/SPARK-7645 and squashes the following commits: 5db6ca1 [zsxwing] Add UIUtils.formatBatchTime e4802df [zsxwing] Show milliseconds in the UI if the batch interval < 1 second
Diffstat (limited to 'core/src/main/resources')
-rw-r--r--core/src/main/resources/org/apache/spark/ui/static/streaming-page.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js b/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js
index 0fac658d57..0ee6752b29 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js
+++ b/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js
@@ -98,7 +98,16 @@ function drawTimeline(id, data, minX, maxX, minY, maxY, unitY, batchInterval) {
var x = d3.scale.linear().domain([minX, maxX]).range([0, width]);
var y = d3.scale.linear().domain([minY, maxY]).range([height, 0]);
- var xAxis = d3.svg.axis().scale(x).orient("bottom").tickFormat(function(d) { return timeFormat[d]; });
+ var xAxis = d3.svg.axis().scale(x).orient("bottom").tickFormat(function(d) {
+ var formattedDate = timeFormat[d];
+ var dotIndex = formattedDate.indexOf('.');
+ if (dotIndex >= 0) {
+ // Remove milliseconds
+ return formattedDate.substring(0, dotIndex);
+ } else {
+ return formattedDate;
+ }
+ });
var formatYValue = d3.format(",.2f");
var yAxis = d3.svg.axis().scale(y).orient("left").ticks(5).tickFormat(formatYValue);