spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] tgravescs commented on a change in pull request #26843: [SPARK-30209][SQL][WEB-UI] Display stageId, attemptId and taskId for max metrics in Spark UI.
Date Wed, 11 Dec 2019 15:27:10 GMT
tgravescs commented on a change in pull request #26843: [SPARK-30209][SQL][WEB-UI] Display
stageId, attemptId and taskId for max metrics in Spark UI.
URL: https://github.com/apache/spark/pull/26843#discussion_r356616273
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala
 ##########
 @@ -142,31 +145,44 @@ object SQLMetrics {
     // probe avg (min, med, max):
     // (1.2, 2.2, 6.3)
     val acc = new SQLMetric(AVERAGE_METRIC)
-    acc.register(sc, name = Some(s"$name (min, med, max)"), countFailedValues = false)
+    acc.register(sc, name = Some(s"$name (min, med, max(stageId(attemptId):taskId)"),
+      countFailedValues = false)
     acc
   }
 
+  private def toNumberFormat(value: Long): String = {
+    val numberFormat = NumberFormat.getNumberInstance(Locale.US)
+    numberFormat.format(value.toDouble / baseForAvgMetric)
+  }
+
+  def metricNeedsMax(metricsType: String): Boolean = {
+    metricsType != SUM_METRIC
+  }
+
   /**
    * A function that defines how we aggregate the final accumulator results among all tasks,
    * and represent it in string for a SQL physical operator.
-   */
-  def stringValue(metricsType: String, values: Array[Long]): String = {
+    */
+  def stringValue(metricsType: String, values: Array[Long], maxMetrics: Array[Long]): String
= {
+
+    // stringMetric = "(driver)" OR (stage $stageId(attempt $attemptId): task $taskId))
+    val stringMetric = if (maxMetrics.isEmpty) "(driver)" else s"(stage ${maxMetrics(1)}"
+
+      s"(attempt ${maxMetrics(2)}): task ${maxMetrics(3)})"
 
 Review comment:
   Please split into normal multiline if/else format since its on multiplelines.
   ```
   if () {
   } else {
   }
   ```
   can you try also adding a space between the stage number and (attempt. Again just to see
if more readable

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message