|
|
@ -465,25 +465,25 @@ class Log(@volatile var dir: File, |
|
|
|
Map("topic" -> topicPartition.topic, "partition" -> topicPartition.partition.toString) ++ maybeFutureTag |
|
|
|
Map("topic" -> topicPartition.topic, "partition" -> topicPartition.partition.toString) ++ maybeFutureTag |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
newGauge("NumLogSegments", |
|
|
|
newGauge(LogMetricNames.NumLogSegments, |
|
|
|
new Gauge[Int] { |
|
|
|
new Gauge[Int] { |
|
|
|
def value = numberOfSegments |
|
|
|
def value = numberOfSegments |
|
|
|
}, |
|
|
|
}, |
|
|
|
tags) |
|
|
|
tags) |
|
|
|
|
|
|
|
|
|
|
|
newGauge("LogStartOffset", |
|
|
|
newGauge(LogMetricNames.LogStartOffset, |
|
|
|
new Gauge[Long] { |
|
|
|
new Gauge[Long] { |
|
|
|
def value = logStartOffset |
|
|
|
def value = logStartOffset |
|
|
|
}, |
|
|
|
}, |
|
|
|
tags) |
|
|
|
tags) |
|
|
|
|
|
|
|
|
|
|
|
newGauge("LogEndOffset", |
|
|
|
newGauge(LogMetricNames.LogEndOffset, |
|
|
|
new Gauge[Long] { |
|
|
|
new Gauge[Long] { |
|
|
|
def value = logEndOffset |
|
|
|
def value = logEndOffset |
|
|
|
}, |
|
|
|
}, |
|
|
|
tags) |
|
|
|
tags) |
|
|
|
|
|
|
|
|
|
|
|
newGauge("Size", |
|
|
|
newGauge(LogMetricNames.Size, |
|
|
|
new Gauge[Long] { |
|
|
|
new Gauge[Long] { |
|
|
|
def value = size |
|
|
|
def value = size |
|
|
|
}, |
|
|
|
}, |
|
|
@ -2297,10 +2297,10 @@ class Log(@volatile var dir: File, |
|
|
|
* remove deleted log metrics |
|
|
|
* remove deleted log metrics |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private[log] def removeLogMetrics(): Unit = { |
|
|
|
private[log] def removeLogMetrics(): Unit = { |
|
|
|
removeMetric("NumLogSegments", tags) |
|
|
|
removeMetric(LogMetricNames.NumLogSegments, tags) |
|
|
|
removeMetric("LogStartOffset", tags) |
|
|
|
removeMetric(LogMetricNames.LogStartOffset, tags) |
|
|
|
removeMetric("LogEndOffset", tags) |
|
|
|
removeMetric(LogMetricNames.LogEndOffset, tags) |
|
|
|
removeMetric("Size", tags) |
|
|
|
removeMetric(LogMetricNames.Size, tags) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -2624,3 +2624,14 @@ object Log { |
|
|
|
file.getPath.endsWith(LogFileSuffix) |
|
|
|
file.getPath.endsWith(LogFileSuffix) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
object LogMetricNames { |
|
|
|
|
|
|
|
val NumLogSegments: String = "NumLogSegments" |
|
|
|
|
|
|
|
val LogStartOffset: String = "LogStartOffset" |
|
|
|
|
|
|
|
val LogEndOffset: String = "LogEndOffset" |
|
|
|
|
|
|
|
val Size: String = "Size" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def allMetricNames: List[String] = { |
|
|
|
|
|
|
|
List(NumLogSegments, LogStartOffset, LogEndOffset, Size) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|