Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,11 @@ private[deploy] class Master(
workers.count(_.state == WorkerState.UNKNOWN) == 0 &&
apps.count(_.state == ApplicationState.UNKNOWN) == 0

private var recoveryStartTimeNs = 0L

private def beginRecovery(storedApps: Seq[ApplicationInfo], storedDrivers: Seq[DriverInfo],
storedWorkers: Seq[WorkerInfo]): Unit = {
recoveryStartTimeNs = System.nanoTime()
for (app <- storedApps) {
logInfo("Trying to recover app: " + app.id)
try {
Expand Down Expand Up @@ -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!")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

}

/**
Expand Down