You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/08 11:46:04 UTC

[GitHub] [spark] sarutak commented on a change in pull request #33253: [SPARK-36038][CORE] Basic speculation metrics summary for a stage

sarutak commented on a change in pull request #33253:
URL: https://github.com/apache/spark/pull/33253#discussion_r666113548



##########
File path: core/src/test/scala/org/apache/spark/status/AppStatusStoreSuite.scala
##########
@@ -204,4 +255,15 @@ class AppStatusStoreSuite extends SparkFunSuite {
     taskMetrics.shuffleWriteMetrics.incRecordsWritten(i)
     taskMetrics
   }
+
+  private def newSpeculationSummaryData(
+      stageId: Int,
+      stageAttemptId: Int): SpeculationStageSummaryWrapper = {
+    val speculationStageSummary = new SpeculationStageSummary(10, 2, 5, 1, 2,
+      Map("original attempt succeeded" -> 1,
+        "speculation attempt succeeded" -> 1
+      ))
+    new SpeculationStageSummaryWrapper(stageId, stageAttemptId, speculationStageSummary)
+  }
+

Review comment:
       ditto.

##########
File path: core/src/test/resources/HistoryServerExpectations/stage_with_speculation_summary_expectation.json
##########
@@ -0,0 +1,7110 @@
+[ {

Review comment:
       Why does this file need to be +7000 lines?
   Currently, `stage_task_list_w__offset___length_expectation.json` has the maximum number of lines among files under `HistoryServerExpectations` and it's 2451 lines.
   Can you minimize this file?

##########
File path: core/src/main/scala/org/apache/spark/status/LiveEntity.scala
##########
@@ -392,6 +392,31 @@ private class LiveExecutorStageSummary(
 
 }
 
+private class LiveSpeculationStageSummary(
+    stageId: Int,
+    attemptId: Int) extends LiveEntity {
+
+  var numTasks = 0
+  var numActiveTasks = 0
+  var numCompletedTasks = 0
+  var numFailedTasks = 0
+  var numKilledTasks = 0
+  var killedTasksSummary : Map[String, Int] = Map()
+
+  override protected def doUpdate(): Any = {
+    val info = new v1.SpeculationStageSummary(
+      numTasks,
+      numActiveTasks,
+      numCompletedTasks,
+      numFailedTasks,
+      numKilledTasks,
+      killedTasksSummary
+    )
+    new SpeculationStageSummaryWrapper(stageId, attemptId, info)
+  }
+

Review comment:
       Please remove unnecessary blank line.




-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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