srdo commented on PR #17139:
URL: https://github.com/apache/kafka/pull/17139#issuecomment-2562702398

   I've implemented the above idea in the latest commit, as input to the 
discussion. It's not quite mergeable, but it should be good enough to show that 
the idea can work. Rather than doing approximation like TimeRatio, it instead 
divides time into fixed-size windows, and submits one exact sample to the 
metric per window.
   
   As far as I can tell, the benefits over TimeRatio is that this metric is 
exact and doesn't have any edge cases related to 0-wide polling intervals.
   
   The drawback is that the metric will be slightly behind, since the measured 
time within a sampling window is only known once the window closes. For 
example, if you have a sampling window size of 10 seconds, the metric will be 
showing values for polls between 0 and 10 seconds in the past, depending on how 
far through the window you are.
   
   If we decide that we'd like to go with this type of metric over the 
TimeRatio approximation, I'd be happy to replace TimeRatio with the new 
fixed-window version, and adapt the tests as necessary. 


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

Reply via email to