bbejeck commented on code in PR #21091:
URL: https://github.com/apache/kafka/pull/21091#discussion_r2595797836
##########
streams/src/main/java/org/apache/kafka/streams/state/internals/MeteredKeyValueStore.java:
##########
@@ -148,8 +154,15 @@ private void registerMetrics() {
e2eLatencySensor =
StateStoreMetrics.e2ELatencySensor(taskId.toString(), metricsScope, name(),
streamsMetrics);
iteratorDurationSensor =
StateStoreMetrics.iteratorDurationSensor(taskId.toString(), metricsScope,
name(), streamsMetrics);
StateStoreMetrics.addNumOpenIteratorsGauge(taskId.toString(),
metricsScope, name(), streamsMetrics,
- (config, now) -> openIterators.sum());
- openIterators = new OpenIterators(taskId, metricsScope, name(),
streamsMetrics);
+ (config, now) -> numOpenIterators.sum());
+ StateStoreMetrics.addOldestOpenIteratorGauge(taskId.toString(),
metricsScope, name(), streamsMetrics,
+ (config, now) -> {
+ try {
+ return openIterators.isEmpty() ? 0L :
openIterators.first().startTimestamp();
Review Comment:
Thanks @justramesh2000 - good point - I updated to use your second
suggestion
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]