ahuang98 commented on PR #17139: URL: https://github.com/apache/kafka/pull/17139#issuecomment-2588464833
> - It's trying to give a more accurate metric by not collapsing each poll interval into a percentage. Instead, it determines the measurement interval by resetting when measure is called. If I understand the metrics code correctly, that means metrics reporters can "interfere" in the sense that the width of these windows will depend on how many metrics reporters you have, and how often they run. > - I think measure is called by the metrics reporters, and measure mutates the state of TimeRatio. Doesn't that mean the internals of TimeRatio need to be made thread safe? I don't have enough knowledge with how folks generally configure metric reporters to comment on this, but these concerns seem reasonable. I'll see if I can get a second opinion on this I am having a hard time following along with your example - specifically starting at this point > We can then look at the latest poll and "fill in" the interval, drawing first from polling seconds (since we know poll "comes before" non-poll), and next from non-polling seconds to hit the exact window size. What I've gleaned is that with a window size of 10s, we are able to calculate the ratio for window 1 (which ends during the 6th second of the third poll) and window 2 is partial and includes everything after that. -- 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