sarutak commented on a change in pull request #27687: [SPARK-30943][SS] Show 
"batch ID" in tool tip string for Structured Streaming UI graphs
URL: https://github.com/apache/spark/pull/27687#discussion_r383589380
 
 

 ##########
 File path: 
streaming/src/main/scala/org/apache/spark/streaming/ui/StreamingPage.scala
 ##########
 @@ -140,6 +140,16 @@ private[ui] class StreamingPage(parent: StreamingTab)
     <script>{Unparsed(js)}</script>
   }
 
+  private def generateTimeTipStrings(times: Seq[Long]): Seq[Node] = {
+    val js = "var timeTipStrings = {};\n" + times.map { time =>
+      val formattedTime =
+        SparkUIUtils.formatBatchTime(time, listener.batchDuration, 
showYYYYMMSS = false)
+      s"timeTipStrings[$time] = '$formattedTime';"
+    }.mkString("\n")
 
 Review comment:
   This logic seems to be the same as 
[here](https://github.com/apache/spark/blob/master/streaming/src/main/scala/org/apache/spark/streaming/ui/StreamingPage.scala#L133).
   Can we do like `s"timeTipStrings[$time] = timeFormat[$time];` or pull out 
the common code?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to