showuon commented on code in PR #12347:
URL: https://github.com/apache/kafka/pull/12347#discussion_r917646894


##########
core/src/main/scala/kafka/log/LogManager.scala:
##########
@@ -410,12 +437,34 @@ class LogManager(logDirs: Seq[File],
         error(s"There was an error in one of the threads during logs loading: 
${e.getCause}")
         throw e.getCause
     } finally {
+      removeLogRecoveryMetrics()
       threadPools.foreach(_.shutdown())
     }
 
     info(s"Loaded $numTotalLogs logs in ${time.hiResClockMs() - startMs}ms.")
   }
 
+  private[log] def addLogRecoveryMetrics(): Unit = {
+    for (dir <- logDirs) {
+      newGauge("remainingLogsToRecover", () => 
numRemainingLogs.get(dir.getAbsolutePath),
+        Map("dir" -> dir.getAbsolutePath))
+      for (i <- 0 until numRecoveryThreadsPerDataDir) {
+        val threadName = s"log-recovery-${dir.getAbsolutePath}-$i"

Review Comment:
   Good suggestion. Updated.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to