ableegoldman commented on a change in pull request #10102:
URL: https://github.com/apache/kafka/pull/10102#discussion_r574078902



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
##########
@@ -776,9 +776,10 @@ void runOnce() {
 
                 log.debug("{} punctuators ran.", punctuated);
 
+                final long beforeCommitTs = now;
                 final int committed = maybeCommit();
                 totalCommittedSinceLastSummary += committed;
-                final long commitLatency = advanceNowAndComputeLatency();
+                final long commitLatency = Math.max(now - beforeCommitTs, 0);

Review comment:
       Also kind of a nit, since technically this does work, but wouldn't it 
make more sense to just remove the `advanceNowAndComputeLatency` call in 
`maybeCommit`, and then just call `advancedNowAndComputeLatency` here as 
before? Otherwise we're just computing the latency inside `maybeCommit` for no 
reason, and throwing out the result. 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to