nicktelford commented on code in PR #16041: URL: https://github.com/apache/kafka/pull/16041#discussion_r1613293262
########## streams/src/main/java/org/apache/kafka/streams/state/internals/MeteredKeyValueStore.java: ########## @@ -169,6 +172,10 @@ private void registerMetrics() { iteratorDurationSensor = StateStoreMetrics.iteratorDurationSensor(taskId.toString(), metricsScope, name(), streamsMetrics); StateStoreMetrics.addNumOpenIteratorsGauge(taskId.toString(), metricsScope, name(), streamsMetrics, (config, now) -> numOpenIterators.get()); + StateStoreMetrics.addOldestOpenIteratorGauge(taskId.toString(), metricsScope, name(), streamsMetrics, + (config, now) -> openIterators.isEmpty() ? null : + openIterators.stream().mapToLong(MeteredIterator::startTimestamp).min().getAsLong() Review Comment: I've pushed a commit with the switch to `ConcurrentSkipListSet`, but I can change it again if we come up with something better. -- 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