You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "yaooqinn (via GitHub)" <gi...@apache.org> on 2023/12/08 01:52:59 UTC

Re: [PR] [SPARK-46313][CORE] Log `Spark HA` recovery duration [spark]

yaooqinn commented on code in PR #44243:
URL: https://github.com/apache/spark/pull/44243#discussion_r1419848636


##########
core/src/main/scala/org/apache/spark/deploy/master/Master.scala:
##########
@@ -662,7 +665,8 @@ private[deploy] class Master(
 
     state = RecoveryState.ALIVE
     schedule()
-    logInfo("Recovery complete - resuming operations!")
+    val timeTakenNs = System.nanoTime() - recoveryStartTimeNs
+    logInfo(s"Recovery complete in ${timeTakenNs / 1000000000d}s - resuming operations!")

Review Comment:
   `0.043445167s` may be less readable for humans. How about rounding to milliseconds?
   
   `TimeUnit.NANOSECONDS.toMillis(timeTakenNs) ms` or `TimeUnit.NANOSECONDS.toMillis(timeTakenNs) / 1000.0 s`



##########
core/src/main/scala/org/apache/spark/deploy/master/Master.scala:
##########
@@ -662,7 +665,8 @@ private[deploy] class Master(
 
     state = RecoveryState.ALIVE
     schedule()
-    logInfo("Recovery complete - resuming operations!")
+    val timeTakenNs = System.nanoTime() - recoveryStartTimeNs
+    logInfo(s"Recovery complete in ${timeTakenNs / 1000000000d}s - resuming operations!")

Review Comment:
   `0.043445167s` may be less readable for humans. How about rounding to milliseconds?
   
   `TimeUnit.NANOSECONDS.toMillis(timeTakenNs) ms` or `TimeUnit.NANOSECONDS.toMillis(timeTakenNs) / 1000.0 s`



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