----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/34418/#review84349 -----------------------------------------------------------
clients/src/main/java/org/apache/kafka/common/metrics/stats/Rate.java <https://reviews.apache.org/r/34418/#comment135564> Hey Jay, My approach differs with your only in this line: long ellapsedPriorWindowsMs = config.timeWindowMs() * (max(stat.samples.size() -1, 1)); I guess my approach is probably a bit more fine grained (and closer to existing code) than yours in the beginning config.timeWindowMs()*(config.samples()-1) ms. After that the behavior is exactly the same. I think this difference doesn't matter in production environment. It allows minutes-long system test a bit more accurate though. I am good with both approaches. - Dong Lin On May 19, 2015, 5:12 p.m., Jay Kreps wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/34418/ > ----------------------------------------------------------- > > (Updated May 19, 2015, 5:12 p.m.) > > > Review request for kafka. > > > Bugs: KAFKA-2191 > https://issues.apache.org/jira/browse/KAFKA-2191 > > > Repository: kafka > > > Description > ------- > > Fix 0 ellapsed time rate bug. > > > Diffs > ----- > > clients/src/main/java/org/apache/kafka/common/metrics/stats/Rate.java > 98429da34418f7f1deba1b5e44e2e6025212edb3 > clients/src/test/java/org/apache/kafka/common/metrics/MetricsTest.java > 544e120594de78c43581a980b1e4087b4fb98ccb > > Diff: https://reviews.apache.org/r/34418/diff/ > > > Testing > ------- > > > Thanks, > > Jay Kreps > >