> On May 13, 2015, 5:14 p.m., Jay Kreps wrote: > > clients/src/main/java/org/apache/kafka/common/metrics/stats/SampledStat.java, > > line 126 > > <https://reviews.apache.org/r/34170/diff/1/?file=958216#file958216line126> > > > > how come we are removing the event count threshold.
Oh.. My bad, I should not remove this one. When I tried to interpret the semantics of SampledStat.measure(), I was confused by the use of eventCount -- I could not understand the meaning of Rate.measure() when both timeWindowMs and eventWindow are used in Sample.isComplete(). And I find that, except for the unit tests, config.eventWindow is always LONG.MAX_VALUE except. I removed it for these two reasons. Now I understand there is use case to use eventWindow to expire sample. Though I still couldn't understand why user will use both timeWindowMs and eventWindow to expire sample. > On May 13, 2015, 5:14 p.m., Jay Kreps wrote: > > clients/src/main/java/org/apache/kafka/common/metrics/stats/Rate.java, line > > 62 > > <https://reviews.apache.org/r/34170/diff/1/?file=958215#file958215line62> > > > > Is this actually right? I agree you'll get discontinuities as the > > measured time shrinks to zero but why is giving back 0 the right answer? In > > the case you guys were testing 0 was safe, but imagine a case where the > > monitoring was checking that the value didn't fall below some threshold. The question is, when Rate.measure() is called right after Rate.record(n), what should be the return value? I think there are two possibilities: 0 and n/config.timeWindowMs(). I didn't find any use case where these two values make a difference. Which value do you think is the best? Thank you. - Dong ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/34170/#review83629 ----------------------------------------------------------- On May 13, 2015, 3:47 p.m., Dong Lin wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/34170/ > ----------------------------------------------------------- > > (Updated May 13, 2015, 3:47 p.m.) > > > Review request for kafka. > > > Bugs: KAFKA-2191 > https://issues.apache.org/jira/browse/KAFKA-2191 > > > Repository: kafka > > > Description > ------- > > KAFKA-2191; Measured rate should not be infinite > > > Diffs > ----- > > clients/src/main/java/org/apache/kafka/common/metrics/stats/Rate.java > 98429da34418f7f1deba1b5e44e2e6025212edb3 > > clients/src/main/java/org/apache/kafka/common/metrics/stats/SampledStat.java > b341b7daaa10204906d78b812fb05fd27bc69373 > > Diff: https://reviews.apache.org/r/34170/diff/ > > > Testing > ------- > > > Thanks, > > Dong Lin > >