You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/12/29 08:27:45 UTC
[GitHub] [kafka] showuon commented on a diff in pull request #13056: KAFKA-14556: make sure log cleaner throttler start time is correct
showuon commented on code in PR #13056:
URL: https://github.com/apache/kafka/pull/13056#discussion_r1058809664
##########
core/src/main/scala/kafka/log/LogCleaner.scala:
##########
@@ -413,21 +408,25 @@ class LogCleaner(initialConfig: CleanerConfig,
def recordStats(id: Int, name: String, from: Long, to: Long, stats: CleanerStats): Unit = {
this.lastStats = stats
def mb(bytes: Double) = bytes / (1024*1024)
+ val bytesReadMb = mb(stats.bytesRead.toDouble)
+ val mapBytesReadMb = mb(stats.mapBytesRead.toDouble)
+ val bytesWrittenMb = mb(stats.bytesWritten.toDouble)
+
val message =
"%n\tLog cleaner thread %d cleaned log %s (dirty section = [%d, %d])%n".format(id, name, from, to) +
- "\t%,.1f MB of log processed in %,.1f seconds (%,.1f MB/sec).%n".format(mb(stats.bytesRead.toDouble),
+ "\t%,.1f MB of log processed in %,.1f seconds (%,.1f MB/sec).%n".format(bytesReadMb,
stats.elapsedSecs,
- mb(stats.bytesRead.toDouble / stats.elapsedSecs)) +
- "\tIndexed %,.1f MB in %.1f seconds (%,.1f Mb/sec, %.1f%% of total time)%n".format(mb(stats.mapBytesRead.toDouble),
+ bytesReadMb / stats.elapsedSecs) +
+ "\tIndexed %,.1f MB in %.1f seconds (%,.1f Mb/sec, %.1f%% of total time)%n".format(mapBytesReadMb,
Review Comment:
No code change, just replace the `mb(stats.bytesRead.toDouble)` as variable `bytesReadMb` and so on.
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org