[
https://issues.apache.org/jira/browse/KAFKA-13647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17488076#comment-17488076
]
Bruno Cadonna commented on KAFKA-13647:
---------------------------------------
[~LGouellec] Thank you for the report!
For each measurement of the number of open files, we record the number of files
opened and the number of files closed since the last measurement. Then we
subtract the number of files closed from the number of files opened. That is
net number of files opened since last measurement (might also be negative). We
then add the net number of files opened since last measurement to the number of
open files which is the sum of all net numbers of files opened between
measurements.
https://github.com/apache/kafka/blob/ca5d6f9229c170beb23809159113037f05a1120f/streams/src/main/java/org/apache/kafka/streams/state/internals/metrics/RocksDBMetricsRecorder.java#L471
So, I think using the sum metric is correct.
Does this make sense?
> RocksDb metrics 'number-open-files' is not correct
> --------------------------------------------------
>
> Key: KAFKA-13647
> URL: https://issues.apache.org/jira/browse/KAFKA-13647
> Project: Kafka
> Issue Type: Bug
> Components: streams
> Affects Versions: 3.0.0
> Reporter: Sylvain Le Gouellec
> Priority: Major
>
> We were looking at RocksDB metrics and noticed that the {{number-open-files}}
> metric behaves like a counter, rather than a gauge.
> Looking at the code, we think there is a small error in the type of metric
> for that specific mbean (should be a value metric rather than a sum metric).
> See [
> https://github.com/apache/kafka/blob/ca5d6f9229c170beb23809159113037f05a1120f/streams/src/main/java/org/apache/kafka/streams/state/internals/metrics/RocksDBMetrics.java#L482|https://github.com/apache/kafka/blob/99b9b3e84f4e98c3f07714e1de6a139a004cbc5b/streams/src/main/java/org/apache/kafka/streams/state/internals/metrics/RocksDBMetrics.java#L482]
--
This message was sent by Atlassian Jira
(v8.20.1#820001)