alanlau28 opened a new pull request, #22452:
URL: https://github.com/apache/kafka/pull/22452

   The `record-e2e-latency` metric at terminal nodes was computed as 
`currentSystemTimeMs() - record.timestamp()`, where `currentSystemTimeMs()` 
returns a wall-clock value cached once at the start of processing a record (set 
by `updateProcessorContext` before `currNode.process()` runs). Because this 
value is captured before the topology executes, processing delays are invisible 
to it.
   
   The fix reads the wall clock freshly at the terminal site, after 
`child.process()` returns. To avoid a clock read per output record the read is 
done lazily: `currentRecordE2ELatencyTimeMs` on `StreamTask` caches the first 
fresh read and is reused for every subsequent terminal recording within the 
same input record's processing. `updateProcessorContext` resets the field to 
`-1` at the start of each record and punctuation, so each input record gets its 
own reading taken after its processing completes.


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

Reply via email to