Skip to content
Snippets Groups Projects
Commit d52bf47e authored by proflin's avatar proflin Committed by Shixiong Zhu
Browse files

[SPARK-12304][STREAMING] Make Spark Streaming web UI display more fri…

…endly Receiver graphs

Currently, the Spark Streaming web UI uses the same maxY when displays 'Input Rate Times& Histograms' and 'Per-Receiver Times& Histograms'.

This may lead to somewhat un-friendly graphs: once we have tens of Receivers or more, every 'Per-Receiver Times' line almost hits the ground.

This issue proposes to calculate a new maxY against the original one, which is shared among all the `Per-Receiver Times& Histograms' graphs.

Before:
![before-5](https://cloud.githubusercontent.com/assets/15843379/11761362/d790c356-a0fa-11e5-860e-4b834603de1d.png)

After:
![after-5](https://cloud.githubusercontent.com/assets/15843379/11761361/cfabf692-a0fa-11e5-97d0-4ad124aaca2a.png)

Author: proflin <proflin.me@gmail.com>

Closes #10318 from proflin/SPARK-12304.
parent ca0690b5
No related branches found
No related tags found
No related merge requests found
......@@ -392,9 +392,15 @@ private[ui] class StreamingPage(parent: StreamingTab)
maxX: Long,
minY: Double,
maxY: Double): Seq[Node] = {
val maxYCalculated = listener.receivedEventRateWithBatchTime.values
.flatMap { case streamAndRates => streamAndRates.map { case (_, eventRate) => eventRate } }
.reduceOption[Double](math.max)
.map(_.ceil.toLong)
.getOrElse(0L)
val content = listener.receivedEventRateWithBatchTime.toList.sortBy(_._1).map {
case (streamId, eventRates) =>
generateInputDStreamRow(jsCollector, streamId, eventRates, minX, maxX, minY, maxY)
generateInputDStreamRow(jsCollector, streamId, eventRates, minX, maxX, minY, maxYCalculated)
}.foldLeft[Seq[Node]](Nil)(_ ++ _)
// scalastyle:off
......
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